[FFmpeg-cvslog] lclenc: make compression level user selectable

Paul B Mahol git at videolan.org
Fri Nov 2 23:16:42 CET 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Nov  2 21:54:44 2012 +0000| [f58f600c6899bcfbc359b7db7b9d2fc50ae6961d] | committer: Paul B Mahol

lclenc: make compression level user selectable

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f58f600c6899bcfbc359b7db7b9d2fc50ae6961d
---

 libavcodec/lclenc.c         |    5 +++--
 tests/ref/fate/vsynth1-zlib |    2 +-
 tests/ref/fate/vsynth2-zlib |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c
index 1702136..09beb98 100644
--- a/libavcodec/lclenc.c
+++ b/libavcodec/lclenc.c
@@ -140,8 +140,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
     avctx->extradata= av_mallocz(8);
     avctx->coded_frame= &c->pic;
 
-    // Will be user settable someday
-    c->compression = 6;
+    c->compression = avctx->compression_level == FF_COMPRESSION_DEFAULT ?
+                            COMP_ZLIB_NORMAL :
+                            av_clip(avctx->compression_level, 0, 9);
     c->flags = 0;
     c->imgtype = IMGTYPE_RGB24;
     avctx->bits_per_coded_sample= 24;
diff --git a/tests/ref/fate/vsynth1-zlib b/tests/ref/fate/vsynth1-zlib
index afd9030..f5441e1 100644
--- a/tests/ref/fate/vsynth1-zlib
+++ b/tests/ref/fate/vsynth1-zlib
@@ -1,4 +1,4 @@
-1aa8c91588a9672b6adb63b98156a104 *tests/data/fate/vsynth1-zlib.avi
+fd52fff386f172bb3aef97761b99331c *tests/data/fate/vsynth1-zlib.avi
 12108632 tests/data/fate/vsynth1-zlib.avi
 93695a27c24a61105076ca7b1f010bbd *tests/data/fate/vsynth1-zlib.out.rawvideo
 stddev:    3.42 PSNR: 37.44 MAXDIFF:   48 bytes:  7603200/  7603200
diff --git a/tests/ref/fate/vsynth2-zlib b/tests/ref/fate/vsynth2-zlib
index fc742db..0a7ed3c 100644
--- a/tests/ref/fate/vsynth2-zlib
+++ b/tests/ref/fate/vsynth2-zlib
@@ -1,4 +1,4 @@
-fa60eac1bfbdf38c773d11d716eb6465 *tests/data/fate/vsynth2-zlib.avi
+d0e240b5241c3e0a5f813644d3dc5d9f *tests/data/fate/vsynth2-zlib.avi
 12517176 tests/data/fate/vsynth2-zlib.avi
 98d0e2854731472c5bf13d8638502d0a *tests/data/fate/vsynth2-zlib.out.rawvideo
 stddev:    1.26 PSNR: 46.10 MAXDIFF:   13 bytes:  7603200/  7603200



More information about the ffmpeg-cvslog mailing list