[FFmpeg-cvslog] dv: better split weight tables assignment

Christophe Gisquet git at videolan.org
Sat Oct 25 17:08:00 CEST 2014


ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Sat Oct 25 11:19:20 2014 +0000| [eacf2e8eb35c3a18cfeddd2aa0ac787949dc7f94] | committer: Michael Niedermayer

dv: better split weight tables assignment

This is a mostly cosmetical patch in preparation for the following.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/dv.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavcodec/dv.c b/libavcodec/dv.c
index 4b23f2a..e1e5dd9 100644
--- a/libavcodec/dv.c
+++ b/libavcodec/dv.c
@@ -186,7 +186,6 @@ int ff_dv_init_dynamic_tables(DVVideoContext *ctx, const AVDVProfile *d)
 {
     int j, i, c, s, p;
     uint32_t *factor1, *factor2;
-    const int *iweight1, *iweight2;
 
     p = i = 0;
     for (c = 0; c < d->n_difchan; c++) {
@@ -206,14 +205,15 @@ int ff_dv_init_dynamic_tables(DVVideoContext *ctx, const AVDVProfile *d)
 
     factor1 = &ctx->idct_factor[0];
     factor2 = &ctx->idct_factor[DV_PROFILE_IS_HD(d) ? 4096 : 2816];
-    if (d->height == 720) {
-        iweight1 = &ff_dv_iweight_720_y[0];
-        iweight2 = &ff_dv_iweight_720_c[0];
-    } else {
-        iweight1 = &ff_dv_iweight_1080_y[0];
-        iweight2 = &ff_dv_iweight_1080_c[0];
-    }
     if (DV_PROFILE_IS_HD(d)) {
+        const int *iweight1, *iweight2;
+        if (d->height == 720) {
+            iweight1 = &ff_dv_iweight_720_y[0];
+            iweight2 = &ff_dv_iweight_720_c[0];
+        } else {
+            iweight1 = &ff_dv_iweight_1080_y[0];
+            iweight2 = &ff_dv_iweight_1080_c[0];
+        }
         for (c = 0; c < 4; c++) {
             for (s = 0; s < 16; s++) {
                 for (i = 0; i < 64; i++) {
@@ -223,7 +223,7 @@ int ff_dv_init_dynamic_tables(DVVideoContext *ctx, const AVDVProfile *d)
             }
         }
     } else {
-        iweight1 = &ff_dv_iweight_88[0];
+        const int *iweight1 = &ff_dv_iweight_88[0];
         for (j = 0; j < 2; j++, iweight1 = &ff_dv_iweight_248[0]) {
             for (s = 0; s < 22; s++) {
                 for (i = c = 0; c < 4; c++) {



More information about the ffmpeg-cvslog mailing list