summaryrefslogtreecommitdiff
path: root/libavcodec/cookdata.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-08 02:28:40 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-08 02:51:45 +0100
commitbf807a5e874442aa3fe1b475459cdd509e34bff4 (patch)
treef8067bfb5e99b8b8e2716a7ea8519a4aaa8ac60f /libavcodec/cookdata.h
parent4cda8aa1c5bc58f8a7f53a21a19b03e7379bbcdc (diff)
parent6eda85e15b38863a627fd0602098aa3250174698 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (29 commits) sbrdsp.asm: convert all instructions to float/SSE ones. dv: cosmetics. dv: check buffer size before reading profile. Revert "AAC SBR: group some writes." udp: Print an error message if bind fails cook: extend channel uncoupling tables so the full bit range is covered. roqvideo: cosmetics. roqvideo: convert to bytestream2 API. dca: don't use av_clip_uintp2(). wmall: fix build with -DDEBUG enabled. smc: port to bytestream2 API. AAC SBR: group some writes. dsputil: remove shift parameter from scalarproduct_int16 SBR DSP: unroll sum_square rv34: remove dead code in intra availability check rv34: clean a bit availability checks. v4l2: update documentation tgq: convert to bytestream2 API. parser: remove forward declaration of MpegEncContext dca: prevent accessing static arrays with invalid indexes. ... Conflicts: doc/indevs.texi libavcodec/Makefile libavcodec/dca.c libavcodec/dvdata.c libavcodec/eatgq.c libavcodec/mmvideo.c libavcodec/roqvideodec.c libavcodec/smc.c libswscale/output.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cookdata.h')
-rw-r--r--libavcodec/cookdata.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/libavcodec/cookdata.h b/libavcodec/cookdata.h
index 15e8e9519f..b854db2db9 100644
--- a/libavcodec/cookdata.h
+++ b/libavcodec/cookdata.h
@@ -510,23 +510,37 @@ static const int cplband[51] = {
19,
};
-static const float cplscale2[3] = {
+// The 1 and 0 at the beginning/end are to prevent overflows with
+// bitstream-read indexes. E.g. if n_bits=5, we can access any
+// index from [1, (1<<n_bits)] for the first decoupling coeff,
+// and (1<<n_bits)-coeff1 as index for coeff2, i.e.:
+// coeff1_idx = [1, 32], and coeff2_idx = [0, 31].
+// These values aren't part of the tables in the original binary.
+
+static const float cplscale2[5] = {
+1,
0.953020632266998,0.70710676908493,0.302905440330505,
+0,
};
-static const float cplscale3[7] = {
+static const float cplscale3[9] = {
+1,
0.981279790401459,0.936997592449188,0.875934481620789,0.70710676908493,
0.482430040836334,0.349335819482803,0.192587479948997,
+0,
};
-static const float cplscale4[15] = {
+static const float cplscale4[17] = {
+1,
0.991486728191376,0.973249018192291,0.953020632266998,0.930133521556854,
0.903453230857849,0.870746195316315,0.826180458068848,0.70710676908493,
0.563405573368073,0.491732746362686,0.428686618804932,0.367221474647522,
0.302905440330505,0.229752898216248,0.130207896232605,
+0,
};
-static const float cplscale5[31] = {
+static const float cplscale5[33] = {
+1,
0.995926380157471,0.987517595291138,0.978726446628571,0.969505727291107,
0.95979779958725,0.949531257152557,0.938616216182709,0.926936149597168,
0.914336204528809,0.900602877140045,0.885426938533783,0.868331849575043,
@@ -535,9 +549,11 @@ static const float cplscale5[31] = {
0.464778542518616,0.434642940759659,0.404955863952637,0.375219136476517,
0.344963222742081,0.313672333955765,0.280692428350449,0.245068684220314,
0.205169528722763,0.157508864998817,0.0901700109243393,
+0,
};
-static const float cplscale6[63] = {
+static const float cplscale6[65] = {
+1,
0.998005926609039,0.993956744670868,0.989822506904602,0.985598564147949,
0.981279790401459,0.976860702037811,0.972335040569305,0.967696130275726,
0.962936460971832,0.958047747612000,0.953020632266998,0.947844684123993,
@@ -554,6 +570,7 @@ static const float cplscale6[63] = {
0.302905440330505,0.286608695983887,0.269728302955627,0.252119421958923,
0.233590632677078,0.213876649737358,0.192587479948997,0.169101938605309,
0.142307326197624,0.109772264957428,0.0631198287010193,
+0,
};
static const float* const cplscales[5] = {