changeset 6155:a425bdc70ac5 libavcodec

Save coded block patterns for future loop filtering.
author kostya
date Fri, 18 Jan 2008 07:04:11 +0000
parents 10e8a0596311
children b5702c981fe2
files rv34.c rv34.h
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rv34.c	Thu Jan 17 08:34:53 2008 +0000
+++ b/rv34.c	Fri Jan 18 07:04:11 2008 +0000
@@ -1012,6 +1012,8 @@
 
     s->qscale = r->si.quant;
     cbp = cbp2 = rv34_decode_mb_header(r, intra_types);
+    r->cbp_luma  [s->mb_x + s->mb_y * s->mb_stride] = cbp;
+    r->cbp_chroma[s->mb_x + s->mb_y * s->mb_stride] = cbp >> 16;
 
     if(cbp == -1)
         return -1;
@@ -1101,6 +1103,8 @@
             r->intra_types_hist = av_realloc(r->intra_types_hist, s->b4_stride * 4 * 2 * sizeof(*r->intra_types_hist));
             r->intra_types = r->intra_types_hist + s->b4_stride * 4;
             r->mb_type = av_realloc(r->mb_type, r->s.mb_stride * r->s.mb_height * sizeof(*r->mb_type));
+            r->cbp_luma   = av_realloc(r->cbp_luma,   r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_luma));
+            r->cbp_chroma = av_realloc(r->cbp_chroma, r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma));
         }
         s->pict_type = r->si.type ? r->si.type : I_TYPE;
         if(MPV_frame_start(s, s->avctx) < 0)
@@ -1188,6 +1192,9 @@
 
     r->mb_type = av_mallocz(r->s.mb_stride * r->s.mb_height * sizeof(*r->mb_type));
 
+    r->cbp_luma   = av_malloc(r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_luma));
+    r->cbp_chroma = av_malloc(r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma));
+
     if(!intra_vlcs[0].cbppattern[0].bits)
         rv34_init_tables();
 
--- a/rv34.h	Thu Jan 17 08:34:53 2008 +0000
+++ b/rv34.h	Fri Jan 18 07:04:11 2008 +0000
@@ -99,6 +99,9 @@
     int rv30;                ///< indicates which RV variasnt is currently decoded
     int rpr;                 ///< one field size in RV30 slice header
 
+    uint16_t *cbp_luma;      ///< CBP values for luma subblocks
+    uint8_t  *cbp_chroma;    ///< CBP values for chroma subblocks
+
     /** 8x8 block available flags (for MV prediction) */
     DECLARE_ALIGNED_8(uint32_t, avail_cache[3*4]);