diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-09 10:29:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-09 10:29:51 +0100 |
commit | 1b5a6d3c4966fb67d79445aca9c1ad6c1ecbdd4b (patch) | |
tree | c9ba394ee683ee33501a52b655542087c9d76071 /libavcodec/flacenc.c | |
parent | 769354348a3acddb36582277a7d3f26e6d179369 (diff) | |
parent | 3a2731cbd31d0c5681ddbc7c78edd5c53c4d0032 (diff) | |
download | ffmpeg-1b5a6d3c4966fb67d79445aca9c1ad6c1ecbdd4b.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
flacenc: ensure the order is within the min/max range in LPC order search
avconv: rescale packet duration to muxer time base when flushing encoders
add 24-bit FLAC encoding to Changelog
rtpenc_aac: Fix calculation of the header size
x86: h264_intrapred: port to cpuflags
Conflicts:
Changelog
libavformat/rtpenc_aac.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/flacenc.c')
-rw-r--r-- | libavcodec/flacenc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index a8841b8f47..a3c4e64114 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -822,14 +822,16 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch) omethod == ORDER_METHOD_8LEVEL) { int levels = 1 << omethod; uint64_t bits[1 << ORDER_METHOD_8LEVEL]; - int order; + int order = -1; int opt_index = levels-1; opt_order = max_order-1; bits[opt_index] = UINT32_MAX; for (i = levels-1; i >= 0; i--) { + int last_order = order; order = min_order + (((max_order-min_order+1) * (i+1)) / levels)-1; - if (order < 0) - order = 0; + order = av_clip(order, min_order - 1, max_order - 1); + if (order == last_order) + continue; s->flac_dsp.lpc_encode(res, smp, n, order+1, coefs[order], shift[order]); bits[i] = find_subframe_rice_params(s, sub, order+1); |