[FFmpeg-cvslog] r9513 - in trunk/libavcodec: cavs.c cavs.h

stefang subversion
Sat Jul 7 07:27:59 CEST 2007


Author: stefang
Date: Sat Jul  7 07:27:59 2007
New Revision: 9513

Log:
move preparation of chroma intra prediction into it's
own inline function


Modified:
   trunk/libavcodec/cavs.c
   trunk/libavcodec/cavs.h

Modified: trunk/libavcodec/cavs.c
==============================================================================
--- trunk/libavcodec/cavs.c	(original)
+++ trunk/libavcodec/cavs.c	Sat Jul  7 07:27:59 2007
@@ -657,20 +657,7 @@ static int decode_mb_i(AVSContext *h, in
     }
 
     /* chroma intra prediction */
-    /* extend borders by one pixel */
-    h->left_border_u[9] = h->left_border_u[8];
-    h->left_border_v[9] = h->left_border_v[8];
-    h->top_border_u[h->mbx*10+9] = h->top_border_u[h->mbx*10+8];
-    h->top_border_v[h->mbx*10+9] = h->top_border_v[h->mbx*10+8];
-    if(h->mbx && h->mby) {
-        h->top_border_u[h->mbx*10] = h->left_border_u[0] = h->topleft_border_u;
-        h->top_border_v[h->mbx*10] = h->left_border_v[0] = h->topleft_border_v;
-    } else {
-        h->left_border_u[0] = h->left_border_u[1];
-        h->left_border_v[0] = h->left_border_v[1];
-        h->top_border_u[h->mbx*10] = h->top_border_u[h->mbx*10+1];
-        h->top_border_v[h->mbx*10] = h->top_border_v[h->mbx*10+1];
-    }
+    load_intra_pred_chroma(h);
     h->intra_pred_c[pred_mode_uv](h->cu, &h->top_border_u[h->mbx*10],
                                   h->left_border_u, h->c_stride);
     h->intra_pred_c[pred_mode_uv](h->cv, &h->top_border_v[h->mbx*10],

Modified: trunk/libavcodec/cavs.h
==============================================================================
--- trunk/libavcodec/cavs.h	(original)
+++ trunk/libavcodec/cavs.h	Sat Jul  7 07:27:59 2007
@@ -276,6 +276,23 @@ static inline void load_intra_pred_luma(
     }
 }
 
+static inline void load_intra_pred_chroma(AVSContext *h) {
+    /* extend borders by one pixel */
+    h->left_border_u[9] = h->left_border_u[8];
+    h->left_border_v[9] = h->left_border_v[8];
+    h->top_border_u[h->mbx*10+9] = h->top_border_u[h->mbx*10+8];
+    h->top_border_v[h->mbx*10+9] = h->top_border_v[h->mbx*10+8];
+    if(h->mbx && h->mby) {
+        h->top_border_u[h->mbx*10] = h->left_border_u[0] = h->topleft_border_u;
+        h->top_border_v[h->mbx*10] = h->left_border_v[0] = h->topleft_border_v;
+    } else {
+        h->left_border_u[0] = h->left_border_u[1];
+        h->left_border_v[0] = h->left_border_v[1];
+        h->top_border_u[h->mbx*10] = h->top_border_u[h->mbx*10+1];
+        h->top_border_v[h->mbx*10] = h->top_border_v[h->mbx*10+1];
+    }
+}
+
 static inline void modify_pred(const int_fast8_t *mod_table, int *mode) {
     *mode = mod_table[*mode];
     if(*mode < 0) {




More information about the ffmpeg-cvslog mailing list