AminetAminet
Search:
85741 packages online
• About
• Recent
• Browse
• Search
• Upload
• Setup
• Services

util/libs/flacdec.lha

Mirror:Random
Showing: m68k-amigaos iconppc-amigaos iconppc-morphos iconi386-aros iconi386-amithlon iconppc-warpup iconppc-powerup icongeneric iconother icon
No screenshot available
Short:FLAC decoder library (68020+/68080)
Author:Renaud Schweingruber, David Reid (dr_flac)
Uploader:renaud schweingruber protonmail com (Renaud Schweingruber)
Type:util/libs
Version:1.0 (27.10.2026)
Architecture:m68k-amigaos >= 3.0
Date:2026-10-27
Requires:68020
Distribution:Aminet
Download:util/libs/flacdec.lha - View contents
Readme:util/libs/flacdec.readme
Downloads:8

flacdec.library 1.0
===================

A shared library that decodes FLAC (Free Lossless Audio Codec) to
16-bit PCM for AmigaOS 3, bit for bit what the reference decoder
gives. Inside is dr_flac by David Reid, with its decoding loops
(LPC prediction, Rice residuals, stereo output) rewritten in 68020
assembler and tuned for the Apollo 68080.

Programs that use it: AmiPlexAmp (Plex client), and yours: the
interface is five functions (see Developer/).

Two builds
----------

  Libs/flacdec.library      any 68020 or better
  Libs/flacdec.library.080  Apollo 68080 (Vampire) only; refuses to
                            open on another CPU. With the FPU on, the
                            prediction of 24-bit files runs on it,
                            bit for bit the same

Copy one of them to LIBS:flacdec.library.

Speed on a Vampire V4 (68080, 99 MHz), CPU time in % of real time,
decoding only:

                              68080 build   FPU off
  44.1 kHz / 16-bit stereo       5.2 %       5.4 %
  96 kHz / 24-bit stereo        11.6 %      13.4 %

Formats: 4 to 32 bits per sample (16-bit output), 1 to 8 channels,
any sample rate, native FLAC (not Ogg FLAC). CRCs are not checked.
Seeking is supported. Input comes from a file or from your own I/O
hook (for example a file that is still being downloaded). Several
programs and tasks can decode at the same time. The 68020 build does
not use the FPU; the 68080 build uses it when it is on (checked for
every subframe: the V4 can switch it off).

For programmers
---------------

  Developer/doc/flacdec.doc               the autodoc
  Developer/include/libraries/flacdec.h   structures and constants
  Developer/include/clib, proto, inline   prototypes, GCC inlines
  Developer/fd/flacdec_lib.fd

  struct FLACDecInfo info;
  APTR dec = FLACDecOpenFile("song.flac", &info);
  LONG n;
  while ((n = FLACDecRead(dec, buffer, 4096)) > 0)
      ... n frames of info.fdi_Channels interleaved WORDs ...
  FLACDecClose(dec);

The functions use up to about 4.6 KB of the caller's stack: call them
with at least 8 KB free.

Tested
------

Against ffmpeg's decoder: 23 files (CD and 96 kHz/24-bit music,
ffmpeg compression levels 0 to 12, LPC orders up to 32, mono, 48 kHz,
every stereo mode, wasted bits), whole decodes and seeks at 7
positions each, both builds; the read hook; the stack use. The FPU
prediction against the integer one on 1152 cases and under constant
interrupts.

License
-------

flacdec.library is free to use and to redistribute in this unchanged
archive. (C) 2026 Renaud Schweingruber. dr_flac by David Reid is
public domain (or MIT-0), https://github.com/mackron/dr_libs.

History
-------

1.0  First release.


Contents of util/libs/flacdec.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[Amiga]                   2019    5427  37.2% -lh5- 7e41 Oct 27 17:45 flacdec/Developer/doc/flacdec.doc
[Amiga]                    184     308  59.7% -lh5- 35a9 Oct 27 17:45 flacdec/Developer/fd/flacdec_lib.fd
[Amiga]                    435     821  53.0% -lh5- 6065 Oct 27 17:45 flacdec/Developer/include/clib/flacdec_protos.h
[Amiga]                    492    1364  36.1% -lh5- 213d Oct 27 17:45 flacdec/Developer/include/inline/flacdec.h
[Amiga]                    919    1819  50.5% -lh5- cd34 Oct 27 17:45 flacdec/Developer/include/libraries/flacdec.h
[Amiga]                    345     756  45.6% -lh5- 2fbc Oct 27 17:45 flacdec/Developer/include/proto/flacdec.h
[Amiga]                   1522    3001  50.7% -lh5- 4f11 Oct 27 18:25 flacdec/flacdec.readme
[Amiga]                  13135   25636  51.2% -lh5- d6dd Oct 27 17:45 flacdec/Libs/flacdec.library
[Amiga]                  15219   30404  50.1% -lh5- 9c36 Oct 27 18:25 flacdec/Libs/flacdec.library.080
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total         9 files   34270   69536  49.3%            Oct 27 23:57
Page generated in 0.02 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>