diff options
author | Claudio Freire <klaussfreire@gmail.com> | 2015-09-03 10:49:17 -0300 |
---|---|---|
committer | Claudio Freire <klaussfreire@gmail.com> | 2015-09-03 11:27:52 -0300 |
commit | 5131ba565792828a44ff275ea4dd53300cc6f119 (patch) | |
tree | c10bde33ef578f6dc922b5c2a7bcd3908133be3d | |
parent | bcb3332b1bc155c0bd05c9a40436b301fede7787 (diff) | |
download | ffmpeg-5131ba565792828a44ff275ea4dd53300cc6f119.tar.gz |
AAC: MIPS: Add missing codebooks in quantize funcs
Add entries on the quantize function tables for the missing
codebooks (which all behave like ZERO)
-rw-r--r-- | libavcodec/mips/aaccoder_mips.c | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/libavcodec/mips/aaccoder_mips.c b/libavcodec/mips/aaccoder_mips.c index 4f7b2c89a7..d22cb5ea22 100644 --- a/libavcodec/mips/aaccoder_mips.c +++ b/libavcodec/mips/aaccoder_mips.c @@ -843,12 +843,38 @@ static void quantize_and_encode_band_cost_ESC_mips(struct AACEncContext *s, } } +static void quantize_and_encode_band_cost_NONE_mips(struct AACEncContext *s, + PutBitContext *pb, const float *in, float *out, + const float *scaled, int size, int scale_idx, + int cb, const float lambda, const float uplim, + int *bits, const float ROUNDING) { + av_assert0(0); +} + +static void quantize_and_encode_band_cost_ZERO_mips(struct AACEncContext *s, + PutBitContext *pb, const float *in, float *out, + const float *scaled, int size, int scale_idx, + int cb, const float lambda, const float uplim, + int *bits, const float ROUNDING) { + int i; + if (bits) + *bits = 0; + if (out) { + for (i = 0; i < size; i += 4) { + out[i ] = 0.0f; + out[i+1] = 0.0f; + out[i+2] = 0.0f; + out[i+3] = 0.0f; + } + } +} + static void (*const quantize_and_encode_band_cost_arr[])(struct AACEncContext *s, PutBitContext *pb, const float *in, float *out, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits, const float ROUNDING) = { - NULL, + quantize_and_encode_band_cost_ZERO_mips, quantize_and_encode_band_cost_SQUAD_mips, quantize_and_encode_band_cost_SQUAD_mips, quantize_and_encode_band_cost_UQUAD_mips, @@ -860,6 +886,10 @@ static void (*const quantize_and_encode_band_cost_arr[])(struct AACEncContext *s quantize_and_encode_band_cost_UPAIR12_mips, quantize_and_encode_band_cost_UPAIR12_mips, quantize_and_encode_band_cost_ESC_mips, + quantize_and_encode_band_cost_NONE_mips, /* cb 12 doesn't exist */ + quantize_and_encode_band_cost_ZERO_mips, + quantize_and_encode_band_cost_ZERO_mips, + quantize_and_encode_band_cost_ZERO_mips, }; #define quantize_and_encode_band_cost( \ @@ -889,6 +919,16 @@ static float get_band_numbits_ZERO_mips(struct AACEncContext *s, return 0; } +static float get_band_numbits_NONE_mips(struct AACEncContext *s, + PutBitContext *pb, const float *in, + const float *scaled, int size, int scale_idx, + int cb, const float lambda, const float uplim, + int *bits) +{ + av_assert0(0); + return 0; +} + static float get_band_numbits_SQUAD_mips(struct AACEncContext *s, PutBitContext *pb, const float *in, const float *scaled, int size, int scale_idx, @@ -1328,6 +1368,10 @@ static float (*const get_band_numbits_arr[])(struct AACEncContext *s, get_band_numbits_UPAIR12_mips, get_band_numbits_UPAIR12_mips, get_band_numbits_ESC_mips, + get_band_numbits_NONE_mips, /* cb 12 doesn't exist */ + get_band_numbits_ZERO_mips, + get_band_numbits_ZERO_mips, + get_band_numbits_ZERO_mips, }; #define get_band_numbits( \ @@ -1369,6 +1413,16 @@ static float get_band_cost_ZERO_mips(struct AACEncContext *s, return cost * lambda; } +static float get_band_cost_NONE_mips(struct AACEncContext *s, + PutBitContext *pb, const float *in, + const float *scaled, int size, int scale_idx, + int cb, const float lambda, const float uplim, + int *bits) +{ + av_assert0(0); + return 0; +} + static float get_band_cost_SQUAD_mips(struct AACEncContext *s, PutBitContext *pb, const float *in, const float *scaled, int size, int scale_idx, @@ -2119,6 +2173,10 @@ static float (*const get_band_cost_arr[])(struct AACEncContext *s, get_band_cost_UPAIR12_mips, get_band_cost_UPAIR12_mips, get_band_cost_ESC_mips, + get_band_cost_NONE_mips, /* cb 12 doesn't exist */ + get_band_cost_ZERO_mips, + get_band_cost_ZERO_mips, + get_band_cost_ZERO_mips, }; #define get_band_cost( \ |