]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
move modification of intra prediction modes into
authorstefang <stefang@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 7 Jul 2007 06:15:05 +0000 (06:15 +0000)
committerstefang <stefang@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 7 Jul 2007 06:15:05 +0000 (06:15 +0000)
it's own inline function

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9514 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/cavs.c
libavcodec/cavs.h
libavcodec/cavsdata.h

index c1b9f49463efdbd45e24ddce6f00e159318cfdd3..e92e869367204a145c3645593d0d86d46b3acf10 100644 (file)
@@ -616,24 +616,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code) {
         av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra chroma pred mode\n");
         return -1;
     }
-
-    /* save pred modes before they get modified */
-    h->pred_mode_Y[3] =  h->pred_mode_Y[5];
-    h->pred_mode_Y[6] =  h->pred_mode_Y[8];
-    h->top_pred_Y[h->mbx*2+0] = h->pred_mode_Y[7];
-    h->top_pred_Y[h->mbx*2+1] = h->pred_mode_Y[8];
-
-    /* modify pred modes according to availability of neighbour samples */
-    if(!(h->flags & A_AVAIL)) {
-        modify_pred(left_modifier_l, &h->pred_mode_Y[4] );
-        modify_pred(left_modifier_l, &h->pred_mode_Y[7] );
-        modify_pred(left_modifier_c, &pred_mode_uv );
-    }
-    if(!(h->flags & B_AVAIL)) {
-        modify_pred(top_modifier_l, &h->pred_mode_Y[4] );
-        modify_pred(top_modifier_l, &h->pred_mode_Y[5] );
-        modify_pred(top_modifier_c, &pred_mode_uv );
-    }
+    modify_mb_i(h, &pred_mode_uv);
 
     /* get coded block pattern */
     if(h->pic_type == FF_I_TYPE)
index a2d050a2b31a059db6b4f08bde6fd1695e4a8ace..2d56d4bb1a2ec608ed1e11e8229f947c2d9c299b 100644 (file)
@@ -224,6 +224,10 @@ typedef struct {
     DCTELEM *block;
 } AVSContext;
 
+extern const int_fast8_t ff_left_modifier_l[8];
+extern const int_fast8_t ff_top_modifier_l[8];
+extern const int_fast8_t ff_left_modifier_c[7];
+extern const int_fast8_t ff_top_modifier_c[7];
 extern const vector_t ff_cavs_un_mv;
 
 static inline void load_intra_pred_luma(AVSContext *h, uint8_t *top,
@@ -301,6 +305,26 @@ static inline void modify_pred(const int_fast8_t *mod_table, int *mode) {
     }
 }
 
+static inline void modify_mb_i(AVSContext *h, int *pred_mode_uv) {
+    /* save pred modes before they get modified */
+    h->pred_mode_Y[3] =  h->pred_mode_Y[5];
+    h->pred_mode_Y[6] =  h->pred_mode_Y[8];
+    h->top_pred_Y[h->mbx*2+0] = h->pred_mode_Y[7];
+    h->top_pred_Y[h->mbx*2+1] = h->pred_mode_Y[8];
+
+    /* modify pred modes according to availability of neighbour samples */
+    if(!(h->flags & A_AVAIL)) {
+        modify_pred(ff_left_modifier_l, &h->pred_mode_Y[4] );
+        modify_pred(ff_left_modifier_l, &h->pred_mode_Y[7] );
+        modify_pred(ff_left_modifier_c, pred_mode_uv );
+    }
+    if(!(h->flags & B_AVAIL)) {
+        modify_pred(ff_top_modifier_l, &h->pred_mode_Y[4] );
+        modify_pred(ff_top_modifier_l, &h->pred_mode_Y[5] );
+        modify_pred(ff_top_modifier_c, pred_mode_uv );
+    }
+}
+
 static inline void set_mvs(vector_t *mv, enum block_t size) {
     switch(size) {
     case BLK_16X16:
index 2b38f39e1a6e1f0fcbd55e89ac15747f20892320..86f7e179bba0eefe1a57115f1bfdf430a28042cb 100644 (file)
@@ -513,9 +513,9 @@ static const uint8_t tc_tab[64] = {
   5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9
 };
 
-static const int_fast8_t left_modifier_l[8] = { 0,-1, 6,-1,-1, 7, 6, 7};
-static const int_fast8_t top_modifier_l[8]  = {-1, 1, 5,-1,-1, 5, 7, 7};
-static const int_fast8_t left_modifier_c[7] = { 5,-1, 2,-1, 6, 5, 6};
-static const int_fast8_t top_modifier_c[7]  = { 4, 1,-1,-1, 4, 6, 6};
+const int_fast8_t ff_left_modifier_l[8] = { 0,-1, 6,-1,-1, 7, 6, 7};
+const int_fast8_t ff_top_modifier_l[8]  = {-1, 1, 5,-1,-1, 5, 7, 7};
+const int_fast8_t ff_left_modifier_c[7] = { 5,-1, 2,-1, 6, 5, 6};
+const int_fast8_t ff_top_modifier_c[7]  = { 4, 1,-1,-1, 4, 6, 6};
 
 #endif // AVCODEC_CAVSDATA_H