[Ffmpeg-cvslog] r5612 - in trunk/libavcodec: cavs.c h264.c

michael subversion
Tue Jul 4 19:06:43 CEST 2006


Author: michael
Date: Tue Jul  4 19:06:43 2006
New Revision: 5612

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

Log:
simplify intra prediction mode decoding


Modified: trunk/libavcodec/cavs.c
==============================================================================
--- trunk/libavcodec/cavs.c	(original)
+++ trunk/libavcodec/cavs.c	Tue Jul  4 19:06:43 2006
@@ -885,17 +885,14 @@
 
         nA = h->pred_mode_Y[pos-1];
         nB = h->pred_mode_Y[pos-3];
-        if((nA == NOT_AVAIL) || (nB == NOT_AVAIL))
-            predpred = 2;
-        else
-            predpred = FFMIN(nA,nB);
-        if(get_bits1(gb))
-            h->pred_mode_Y[pos] = predpred;
-        else {
-            h->pred_mode_Y[pos] = get_bits(gb,2);
-            if(h->pred_mode_Y[pos] >= predpred)
-                h->pred_mode_Y[pos]++;
+        predpred = FFMIN(nA,nB);
+        if(predpred == NOT_AVAIL) // if either is not available
+            predpred = INTRA_L_LP;
+        if(!get_bits1(gb)){
+            int rem_mode= get_bits(gb, 2);
+            predpred = rem_mode + (rem_mode >= predpred);
         }
+        h->pred_mode_Y[pos] = predpred;
     }
     pred_mode_uv = get_ue_golomb(gb);
     if(pred_mode_uv > 6) {

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Tue Jul  4 19:06:43 2006
@@ -5258,18 +5258,11 @@
 
 //                fill_intra4x4_pred_table(h);
                 for(i=0; i<16; i+=di){
-                    const int mode_coded= !get_bits1(&s->gb);
-                    const int predicted_mode=  pred_intra_mode(h, i);
-                    int mode;
+                    int mode= pred_intra_mode(h, i);
 
-                    if(mode_coded){
+                    if(!get_bits1(&s->gb)){
                         const int rem_mode= get_bits(&s->gb, 3);
-                        if(rem_mode<predicted_mode)
-                            mode= rem_mode;
-                        else
-                            mode= rem_mode + 1;
-                    }else{
-                        mode= predicted_mode;
+                        mode = rem_mode + (rem_mode >= mode);
                     }
 
                     if(di==4)




More information about the ffmpeg-cvslog mailing list