From fe790f89e81e489b941caae278cb2fac163a4595 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sun, 30 Mar 2008 16:01:10 +0000 Subject: [PATCH] Use 15-bit LPC precision by default. This generally gives better compression results. Also update Ogg regression test. Originally committed as revision 12630 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/flacenc.c | 12 ++---------- tests/libav.regression.ref | 6 +++--- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 2f07ac56a9..fbef3c9e57 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -367,16 +367,8 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) } s->options.lpc_coeff_precision = avctx->lpc_coeff_precision; } else { - /* select LPC precision based on block size */ - if( s->blocksize <= 192) s->options.lpc_coeff_precision = 7; - else if(s->blocksize <= 384) s->options.lpc_coeff_precision = 8; - else if(s->blocksize <= 576) s->options.lpc_coeff_precision = 9; - else if(s->blocksize <= 1152) s->options.lpc_coeff_precision = 10; - else if(s->blocksize <= 2304) s->options.lpc_coeff_precision = 11; - else if(s->blocksize <= 4608) s->options.lpc_coeff_precision = 12; - else if(s->blocksize <= 8192) s->options.lpc_coeff_precision = 13; - else if(s->blocksize <= 16384) s->options.lpc_coeff_precision = 14; - else s->options.lpc_coeff_precision = 15; + /* default LPC precision */ + s->options.lpc_coeff_precision = 15; } av_log(avctx, AV_LOG_DEBUG, " lpc precision: %d\n", s->options.lpc_coeff_precision); diff --git a/tests/libav.regression.ref b/tests/libav.regression.ref index 16c1b4727e..7a555c16bc 100644 --- a/tests/libav.regression.ref +++ b/tests/libav.regression.ref @@ -84,9 +84,9 @@ ae3a23a7ea13c92a2909445ca8144dcd *./tests/data/b-libav.aif 8d117c49d6b210abe783d1b0b897cec7 *./tests/data/b-libav.voc 32768 ./tests/data/b-libav.voc ./tests/data/b-libav.voc CRC=0x49972c8c -8ac1fa6e0ee5d47ea98aea17b67d5908 *./tests/data/b-libav.ogg -23596 ./tests/data/b-libav.ogg -./tests/data/b-libav.ogg CRC=0x93baa056 +9268c90bd2623a5ab3c2a1a751826f69 *./tests/data/b-libav.ogg + 14210 ./tests/data/b-libav.ogg +./tests/data/b-libav.ogg CRC=0x6bcbb966 ce356ce2708cb6033ab5d762da93cfd4 *./tests/data/b-libav-yuv420p.yuv 304128 ./tests/data/b-libav-yuv420p.yuv ce356ce2708cb6033ab5d762da93cfd4 *./tests/data/b-libav-yuv422p.yuv