[FFmpeg-cvslog] aic: use chroma scan tables while decoding luma component in progressive mode

Kostya Shishkov git at videolan.org
Fri Jul 5 11:46:39 CEST 2013


ffmpeg | branch: master | Kostya Shishkov <kostya.shishkov at gmail.com> | Wed Jul  3 20:46:28 2013 +0200| [410066986f443112ed88f501e987b6ca51ed7bd4] | committer: Kostya Shishkov

aic: use chroma scan tables while decoding luma component in progressive mode

For some unclear reason Apple decided to use the same scan tables for luma and
chroma in the progressive mode while using different ones for luma in the
interlaced mode.

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

 libavcodec/aic.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavcodec/aic.c b/libavcodec/aic.c
index a871762..e46c003 100644
--- a/libavcodec/aic.c
+++ b/libavcodec/aic.c
@@ -196,11 +196,11 @@ static int aic_decode_header(AICContext *ctx, const uint8_t *src, int size)
     } while (0)
 
 static int aic_decode_coeffs(GetBitContext *gb, int16_t *dst,
-                             int band, int slice_width)
+                             int band, int slice_width, int force_chroma)
 {
     int has_skips, coeff_type, coeff_bits, skip_type, skip_bits;
     const int num_coeffs = aic_num_band_coeffs[band];
-    const uint8_t *scan = aic_scan[band];
+    const uint8_t *scan = aic_scan[band | force_chroma];
     int mb, idx, val;
 
     has_skips  = get_bits1(gb);
@@ -319,7 +319,8 @@ static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y,
            sizeof(*ctx->slice_data) * slice_width * AIC_BAND_COEFFS);
     for (i = 0; i < NUM_BANDS; i++)
         if ((ret = aic_decode_coeffs(&gb, ctx->data_ptr[i],
-                                     i, slice_width)) < 0)
+                                     i, slice_width,
+                                     !ctx->interlaced)) < 0)
             return ret;
 
     for (mb = 0; mb < slice_width; mb++) {
@@ -334,7 +335,7 @@ static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y,
             ctx->dsp.idct(ctx->block);
 
             if (!ctx->interlaced) {
-                dst = Y + (blk & 1) * 8 * ystride + (blk >> 1) * 8;
+                dst = Y + (blk >> 1) * 8 * ystride + (blk & 1) * 8;
                 ctx->dsp.put_signed_pixels_clamped(ctx->block, dst,
                                                    ystride);
             } else {



More information about the ffmpeg-cvslog mailing list