[FFmpeg-soc] [soc]: r1355 - rv40/rv40.c

kostya subversion at mplayerhq.hu
Mon Sep 17 08:31:37 CEST 2007


Author: kostya
Date: Mon Sep 17 08:31:37 2007
New Revision: 1355

Log:
Remove code duplication

Modified:
   rv40/rv40.c

Modified: rv40/rv40.c
==============================================================================
--- rv40/rv40.c	(original)
+++ rv40/rv40.c	Mon Sep 17 08:31:37 2007
@@ -630,7 +630,7 @@ static inline int get_omega(GetBitContex
  */
 static int rv30_decode_intra_types(RV40DecContext *r, GetBitContext *gb, int *dst)
 {
-    int i, j;
+    int i, j, k;
     int A, B;
     int *ptr;
     int code;
@@ -643,19 +643,14 @@ static int rv30_decode_intra_types(RV40D
                 av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction code\n");
                 return -1;
             }
-            A = ptr[-r->intra_types_stride] + 1;
-            B = ptr[-1] + 1;
-            *ptr++ = rv30_itype_from_context[A * 90 + B * 9 + rv30_itype_code[code + 0]];
-            if(ptr[-1] == 9){
-                av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction mode\n");
-                return -1;
-            }
-            A = ptr[-r->intra_types_stride] + 1;
-            B = ptr[-1] + 1;
-            *ptr++ = rv30_itype_from_context[A * 90 + B * 9 + rv30_itype_code[code + 1]];
-            if(ptr[-1] == 9){
-                av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction mode\n");
-                return -1;
+            for(k = 0; k < 2; k++){
+                A = ptr[-r->intra_types_stride] + 1;
+                B = ptr[-1] + 1;
+                *ptr++ = rv30_itype_from_context[A * 90 + B * 9 + rv30_itype_code[code + k]];
+                if(ptr[-1] == 9){
+                    av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction mode\n");
+                    return -1;
+                }
             }
         }
     }



More information about the FFmpeg-soc mailing list