* qatar/master: vorbisdec: Rename silly "class_" variable to plain "class". simple_idct_alpha: Drop some useless casts. Simplify av_log_missing_feature(). ac3enc: remove check for mismatching channels and channel_layout If AVCodecContext.channels is 0 and AVCodecContext.channel_layout is non-zero, set channels based on channel_layout. If AVCodecContext.channel_layout and AVCodecContext.channels are both non-zero, check to make sure they do not contradict eachother. cosmetics: indentation Check AVCodec.supported_samplerates and AVCodec.channel_layouts in avcodec_open(). aacdec: remove sf_scale and sf_offset. aacdec: use a scale of 2 in the LTP MDCT rather than doubling the coefficient table values from the spec. Define POW_SF2_ZERO in aac.h and use for ff_aac_pow2sf_tabp[] offsets instead of hardcoding 200 everywhere. Large intensity stereo and PNS indices are legal. Clip them instead of erroring out. A magnitude of 100 corresponds to 2^25 so the will most likely result in clipped output anyway. qpeg: use reget_buffer() in decode_frame() ultimotion: use reget_buffer() in ulti_decode_frame() smacker: remove unnecessary call to avctx->release_buffer in decode_frame() avparser: don't av_malloc(0).
Showing the changes to libavcodec/aaccoder.c (1 of 12 files). Show all
Unified · Split
| @@ -109,8 +109,8 @@ static av_always_inline float quantize_and_encode_band_cost_template( · 108 unmodified lines | |||
| 109 | int *bits, int BT_ZERO, int BT_UNSIGNED, | 109 | int *bits, int BT_ZERO, int BT_UNSIGNED, |
| 110 | int BT_PAIR, int BT_ESC) | 110 | int BT_PAIR, int BT_ESC) |
| 111 | { | 111 | { |
| 112 | const float IQ = ff_aac_pow2sf_tab[200 + scale_idx - SCALE_ONE_POS + SCALE_DIV_512]; | 112 | const float IQ = ff_aac_pow2sf_tab[POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512]; |
| 113 | const float Q = ff_aac_pow2sf_tab[200 - scale_idx + SCALE_ONE_POS - SCALE_DIV_512]; | 113 | const float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512]; |
| 114 | const float CLIPPED_ESCAPE = 165140.0f*IQ; | 114 | const float CLIPPED_ESCAPE = 165140.0f*IQ; |
| 115 | int i, j; | 115 | int i, j; |
| 116 | float cost = 0; | 116 | float cost = 0; |
| @@ -281,7 +281,7 @@ static float find_max_val(int group_len, int swb_size, const float *scaled) { · 164 unmodified lines | |||
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | static int find_min_book(float maxval, int sf) { | 283 | static int find_min_book(float maxval, int sf) { |
| 284 | float Q = ff_aac_pow2sf_tab[200 - sf + SCALE_ONE_POS - SCALE_DIV_512]; | 284 | float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512]; |
| 285 | float Q34 = sqrtf(Q * sqrtf(Q)); | 285 | float Q34 = sqrtf(Q * sqrtf(Q)); |
| 286 | int qmaxval, cb; | 286 | int qmaxval, cb; |
| 287 | qmaxval = maxval * Q34 + 0.4054f; | 287 | qmaxval = maxval * Q34 + 0.4054f; |
| @@ -956,7 +956,7 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s, · 668 unmodified lines | |||
| 956 | dist -= b; | 956 | dist -= b; |
| 957 | } | 957 | } |
| 958 | dist *= 1.0f / 512.0f / lambda; | 958 | dist *= 1.0f / 512.0f / lambda; |
| 959 | quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[200 - scf + SCALE_ONE_POS - SCALE_DIV_512]); | 959 | quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[POW_SF2_ZERO - scf + SCALE_ONE_POS - SCALE_DIV_512]); |
| 960 | if (quant_max >= 8191) { // too much, return to the previous quantizer | 960 | if (quant_max >= 8191) { // too much, return to the previous quantizer |
| 961 | sce->sf_idx[w*16+g] = prev_scf; | 961 | sce->sf_idx[w*16+g] = prev_scf; |
| 962 | break; | 962 | break; |