summary refs log tree commit diff
path: root/pkgs/development/libraries/a52dec/A00-a52-state-t-public.patch
diff options
context:
space:
mode:
authorWout Mertens <Wout.Mertens@gmail.com>2014-05-04 01:15:16 +0200
committerWout Mertens <Wout.Mertens@gmail.com>2014-05-04 01:56:48 +0200
commitac80d4541997132d55b5af3707257f605dd897fd (patch)
tree4e511a10366886a6116d047a21d3ced88ee28493 /pkgs/development/libraries/a52dec/A00-a52-state-t-public.patch
parentead35d9d042db1cc85394a69039238453708600e (diff)
downloadnixpkgs-ac80d4541997132d55b5af3707257f605dd897fd.tar
nixpkgs-ac80d4541997132d55b5af3707257f605dd897fd.tar.gz
nixpkgs-ac80d4541997132d55b5af3707257f605dd897fd.tar.bz2
nixpkgs-ac80d4541997132d55b5af3707257f605dd897fd.tar.lz
nixpkgs-ac80d4541997132d55b5af3707257f605dd897fd.tar.xz
nixpkgs-ac80d4541997132d55b5af3707257f605dd897fd.tar.zst
nixpkgs-ac80d4541997132d55b5af3707257f605dd897fd.zip
a52dec: Add patches from Handbrake project
this project hasn't been updated in 10 years, so adding patches that
don't break the API should be ok.

Patches:
- A00: Make a52-state-t public
- A01: Make it thread-safe (changing internal API by adding state
objects)
- A02: Quell common error
- A03: Fix for automake vs autoconf
Diffstat (limited to 'pkgs/development/libraries/a52dec/A00-a52-state-t-public.patch')
-rw-r--r--pkgs/development/libraries/a52dec/A00-a52-state-t-public.patch152
1 files changed, 152 insertions, 0 deletions
diff --git a/pkgs/development/libraries/a52dec/A00-a52-state-t-public.patch b/pkgs/development/libraries/a52dec/A00-a52-state-t-public.patch
new file mode 100644
index 00000000000..5e0af3577d6
--- /dev/null
+++ b/pkgs/development/libraries/a52dec/A00-a52-state-t-public.patch
@@ -0,0 +1,152 @@
+diff -Naur a52dec.old/include/a52.h a52dec.new/include/a52.h
+--- a52dec.old/include/a52.h	2002-01-28 06:37:54.000000000 +0100
++++ a52dec.new/include/a52.h	2012-07-16 14:13:35.000000000 +0200
+@@ -30,7 +30,71 @@
+ typedef double sample_t;
+ #endif
+ 
+-typedef struct a52_state_s a52_state_t;
++typedef struct {
++    uint8_t bai;              /* fine SNR offset, fast gain */
++    uint8_t deltbae;          /* delta bit allocation exists */
++    int8_t deltba[50];        /* per-band delta bit allocation */
++} ba_t;
++
++typedef struct {
++    uint8_t exp[256];         /* decoded channel exponents */
++    int8_t bap[256];          /* derived channel bit allocation */
++} expbap_t;
++
++typedef struct {
++    uint8_t fscod;            /* sample rate */
++    uint8_t halfrate;         /* halfrate factor */
++    uint8_t acmod;            /* coded channels */
++    uint8_t lfeon;            /* coded lfe channel */
++    sample_t clev;            /* centre channel mix level */
++    sample_t slev;            /* surround channels mix level */
++
++    int output;               /* type of output */
++    sample_t level;           /* output level */
++    sample_t bias;            /* output bias */
++
++    int dynrnge;              /* apply dynamic range */
++    sample_t dynrng;          /* dynamic range */
++    void * dynrngdata;        /* dynamic range callback funtion and data */
++    sample_t (* dynrngcall) (sample_t range, void * dynrngdata);
++
++    uint8_t chincpl;          /* channel coupled */
++    uint8_t phsflginu;        /* phase flags in use (stereo only) */
++    uint8_t cplstrtmant;      /* coupling channel start mantissa */
++    uint8_t cplendmant;       /* coupling channel end mantissa */
++    uint32_t cplbndstrc;      /* coupling band structure */
++    sample_t cplco[5][18];    /* coupling coordinates */
++
++    /* derived information */
++    uint8_t cplstrtbnd;       /* coupling start band (for bit allocation) */
++    uint8_t ncplbnd;          /* number of coupling bands */
++
++    uint8_t rematflg;         /* stereo rematrixing */
++
++    uint8_t endmant[5];       /* channel end mantissa */
++
++    uint16_t bai;             /* bit allocation information */
++
++    uint32_t * buffer_start;
++    uint16_t lfsr_state;      /* dither state */
++    uint32_t bits_left;
++    uint32_t current_word;
++
++    uint8_t csnroffst;        /* coarse SNR offset */
++    ba_t cplba;               /* coupling bit allocation parameters */
++    ba_t ba[5];               /* channel bit allocation parameters */
++    ba_t lfeba;               /* lfe bit allocation parameters */
++
++    uint8_t cplfleak;         /* coupling fast leak init */
++    uint8_t cplsleak;         /* coupling slow leak init */
++
++    expbap_t cpl_expbap;
++    expbap_t fbw_expbap[5];
++    expbap_t lfe_expbap;
++
++    sample_t * samples;
++    int downmixed;
++} a52_state_t;
+ 
+ #define A52_CHANNEL 0
+ #define A52_MONO 1
+diff -Naur a52dec.old/liba52/a52_internal.h a52dec.new/liba52/a52_internal.h
+--- a52dec.old/liba52/a52_internal.h	2002-07-28 03:52:06.000000000 +0200
++++ a52dec.new/liba52/a52_internal.h	2012-07-16 14:11:47.000000000 +0200
+@@ -21,72 +21,6 @@
+  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  */
+ 
+-typedef struct {
+-    uint8_t bai;		/* fine SNR offset, fast gain */
+-    uint8_t deltbae;		/* delta bit allocation exists */
+-    int8_t deltba[50];		/* per-band delta bit allocation */
+-} ba_t;
+-
+-typedef struct {
+-    uint8_t exp[256];		/* decoded channel exponents */
+-    int8_t bap[256];		/* derived channel bit allocation */
+-} expbap_t;
+-
+-struct a52_state_s {
+-    uint8_t fscod;		/* sample rate */
+-    uint8_t halfrate;		/* halfrate factor */
+-    uint8_t acmod;		/* coded channels */
+-    uint8_t lfeon;		/* coded lfe channel */
+-    sample_t clev;		/* centre channel mix level */
+-    sample_t slev;		/* surround channels mix level */
+-
+-    int output;			/* type of output */
+-    sample_t level;		/* output level */
+-    sample_t bias;		/* output bias */
+-
+-    int dynrnge;		/* apply dynamic range */
+-    sample_t dynrng;		/* dynamic range */
+-    void * dynrngdata;		/* dynamic range callback funtion and data */
+-    sample_t (* dynrngcall) (sample_t range, void * dynrngdata);
+-
+-    uint8_t chincpl;		/* channel coupled */
+-    uint8_t phsflginu;		/* phase flags in use (stereo only) */
+-    uint8_t cplstrtmant;	/* coupling channel start mantissa */
+-    uint8_t cplendmant;		/* coupling channel end mantissa */
+-    uint32_t cplbndstrc;	/* coupling band structure */
+-    sample_t cplco[5][18];	/* coupling coordinates */
+-
+-    /* derived information */
+-    uint8_t cplstrtbnd;		/* coupling start band (for bit allocation) */
+-    uint8_t ncplbnd;		/* number of coupling bands */
+-
+-    uint8_t rematflg;		/* stereo rematrixing */
+-
+-    uint8_t endmant[5];		/* channel end mantissa */
+-
+-    uint16_t bai;		/* bit allocation information */
+-
+-    uint32_t * buffer_start;
+-    uint16_t lfsr_state;	/* dither state */
+-    uint32_t bits_left;
+-    uint32_t current_word;
+-
+-    uint8_t csnroffst;		/* coarse SNR offset */
+-    ba_t cplba;			/* coupling bit allocation parameters */
+-    ba_t ba[5];			/* channel bit allocation parameters */
+-    ba_t lfeba;			/* lfe bit allocation parameters */
+-
+-    uint8_t cplfleak;		/* coupling fast leak init */
+-    uint8_t cplsleak;		/* coupling slow leak init */
+-
+-    expbap_t cpl_expbap;
+-    expbap_t fbw_expbap[5];
+-    expbap_t lfe_expbap;
+-
+-    sample_t * samples;
+-    int downmixed;
+-};
+-
+ #define LEVEL_PLUS6DB 2.0
+ #define LEVEL_PLUS3DB 1.4142135623730951
+ #define LEVEL_3DB 0.7071067811865476