Browse Source

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  ulti: Fix invalid reads
  lavf: dealloc private options in av_write_trailer
  yadif: support 10bit YUV
  vc1: mark with ER_MB_ERROR bits overconsumption
  lavc: introduce ER_MB_END and ER_MB_ERROR
  error_resilience: use the ER_ namespace
  build: move inclusion of subdir.mak to main subdir loop
  rv34: NEON optimised 4x4 dequant
  rv34: move 4x4 dequant to RV34DSPContext
  aacdec: Use intfloat.h rather than local punning union.

Conflicts:
	libavcodec/h264.c
	libavcodec/vc1dec.c
	libavfilter/vf_yadif.c
	libavformat/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Michael Niedermayer 13 years ago
parent
commit
3ba0bfe71f

+ 1 - 0
Makefile

@@ -77,6 +77,7 @@ define DOSUBDIR
 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
 SUBDIR := $(1)/
 include $(SRC_PATH)/$(1)/Makefile
+include $(SRC_PATH)/subdir.mak
 endef
 
 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))

+ 0 - 2
libavcodec/Makefile

@@ -732,8 +732,6 @@ DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
 
 CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
 
-include $(SRC_PATH)/subdir.mak
-
 $(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o
 
 TRIG_TABLES  = cos cos_fixed sin

+ 7 - 11
libavcodec/aacdec.c

@@ -98,6 +98,7 @@
 #include "aacsbr.h"
 #include "mpeg4audio.h"
 #include "aacadtsdec.h"
+#include "libavutil/intfloat.h"
 
 #include <assert.h>
 #include <errno.h>
@@ -108,11 +109,6 @@
 #   include "arm/aac.h"
 #endif
 
-union float754 {
-    float f;
-    uint32_t i;
-};
-
 static VLC vlc_scalefactors;
 static VLC vlc_spectral[11];
 
@@ -1023,7 +1019,7 @@ static inline float *VMUL4(float *dst, const float *v, unsigned idx,
 static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
                             unsigned sign, const float *scale)
 {
-    union float754 s0, s1;
+    union av_intfloat32 s0, s1;
 
     s0.f = s1.f = *scale;
     s0.i ^= sign >> 1 << 31;
@@ -1041,8 +1037,8 @@ static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
                             unsigned sign, const float *scale)
 {
     unsigned nz = idx >> 12;
-    union float754 s = { .f = *scale };
-    union float754 t;
+    union av_intfloat32 s = { .f = *scale };
+    union av_intfloat32 t;
 
     t.i = s.i ^ (sign & 1U<<31);
     *dst++ = v[idx    & 3] * t.f;
@@ -1291,7 +1287,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
 
 static av_always_inline float flt16_round(float pf)
 {
-    union float754 tmp;
+    union av_intfloat32 tmp;
     tmp.f = pf;
     tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U;
     return tmp.f;
@@ -1299,7 +1295,7 @@ static av_always_inline float flt16_round(float pf)
 
 static av_always_inline float flt16_even(float pf)
 {
-    union float754 tmp;
+    union av_intfloat32 tmp;
     tmp.f = pf;
     tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U;
     return tmp.f;
@@ -1307,7 +1303,7 @@ static av_always_inline float flt16_even(float pf)
 
 static av_always_inline float flt16_trunc(float pf)
 {
-    union float754 pun;
+    union av_intfloat32 pun;
     pun.f = pf;
     pun.i &= 0xFFFF0000U;
     return pun.f;

+ 3 - 0
libavcodec/arm/rv34dsp_init_neon.c

@@ -25,9 +25,12 @@
 
 void ff_rv34_inv_transform_neon(DCTELEM *block);
 void ff_rv34_inv_transform_noround_neon(DCTELEM *block);
+void ff_rv34_dequant4x4_neon(DCTELEM *block, int Qdc, int Q);
 
 void ff_rv34dsp_init_neon(RV34DSPContext *c, DSPContext* dsp)
 {
     c->rv34_inv_transform_tab[0] = ff_rv34_inv_transform_neon;
     c->rv34_inv_transform_tab[1] = ff_rv34_inv_transform_noround_neon;
+
+    c->rv34_dequant4x4 = ff_rv34_dequant4x4_neon;
 }

+ 24 - 0
libavcodec/arm/rv34dsp_neon.S

@@ -107,3 +107,27 @@ function ff_rv34_inv_transform_noround_neon, export=1
         vst4.16         {d0[3], d1[3], d2[3], d3[3]}, [r2,:64], r1
         bx              lr
 endfunc
+
+function ff_rv34_dequant4x4_neon, export=1
+        mov             r3,  r0
+        mov             r12, #16
+        vdup.16         q0,  r2
+        vmov.16         d0[0], r1
+        vld1.16         {d2},     [r0,:64], r12
+        vld1.16         {d4},     [r0,:64], r12
+        vld1.16         {d6},     [r0,:64], r12
+        vld1.16         {d16},    [r0,:64], r12
+        vmull.s16       q1,  d2,  d0
+        vmull.s16       q2,  d4,  d1
+        vmull.s16       q3,  d6,  d1
+        vmull.s16       q8,  d16, d1
+        vqrshrn.s32     d2,  q1,  #4
+        vqrshrn.s32     d4,  q2,  #4
+        vqrshrn.s32     d6,  q3,  #4
+        vqrshrn.s32     d16, q8,  #4
+        vst1.16         {d2},     [r3,:64], r12
+        vst1.16         {d4},     [r3,:64], r12
+        vst1.16         {d6},     [r3,:64], r12
+        vst1.16         {d16},    [r3,:64], r12
+        bx              lr
+endfunc

+ 45 - 45
libavcodec/error_resilience.c

@@ -167,14 +167,14 @@ static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, i
             error= s->error_status_table[mb_index];
 
             if(IS_INTER(s->current_picture.f.mb_type[mb_index])) continue; //inter
-            if(!(error&DC_ERROR)) continue;           //dc-ok
+            if(!(error&ER_DC_ERROR)) continue;           //dc-ok
 
             /* right block */
             for(j=b_x+1; j<w; j++){
                 int mb_index_j= (j>>is_luma) + (b_y>>is_luma)*s->mb_stride;
                 int error_j= s->error_status_table[mb_index_j];
                 int intra_j = IS_INTRA(s->current_picture.f.mb_type[mb_index_j]);
-                if(intra_j==0 || !(error_j&DC_ERROR)){
+                if(intra_j==0 || !(error_j&ER_DC_ERROR)){
                     color[0]= dc[j + b_y*stride];
                     distance[0]= j-b_x;
                     break;
@@ -186,7 +186,7 @@ static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, i
                 int mb_index_j= (j>>is_luma) + (b_y>>is_luma)*s->mb_stride;
                 int error_j= s->error_status_table[mb_index_j];
                 int intra_j = IS_INTRA(s->current_picture.f.mb_type[mb_index_j]);
-                if(intra_j==0 || !(error_j&DC_ERROR)){
+                if(intra_j==0 || !(error_j&ER_DC_ERROR)){
                     color[1]= dc[j + b_y*stride];
                     distance[1]= b_x-j;
                     break;
@@ -198,7 +198,7 @@ static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, i
                 int mb_index_j= (b_x>>is_luma) + (j>>is_luma)*s->mb_stride;
                 int error_j= s->error_status_table[mb_index_j];
                 int intra_j = IS_INTRA(s->current_picture.f.mb_type[mb_index_j]);
-                if(intra_j==0 || !(error_j&DC_ERROR)){
+                if(intra_j==0 || !(error_j&ER_DC_ERROR)){
                     color[2]= dc[b_x + j*stride];
                     distance[2]= j-b_y;
                     break;
@@ -210,7 +210,7 @@ static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, i
                 int mb_index_j= (b_x>>is_luma) + (j>>is_luma)*s->mb_stride;
                 int error_j= s->error_status_table[mb_index_j];
                 int intra_j = IS_INTRA(s->current_picture.f.mb_type[mb_index_j]);
-                if(intra_j==0 || !(error_j&DC_ERROR)){
+                if(intra_j==0 || !(error_j&ER_DC_ERROR)){
                     color[3]= dc[b_x + j*stride];
                     distance[3]= b_y-j;
                     break;
@@ -250,8 +250,8 @@ static void h_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int st
             int right_status= s->error_status_table[((b_x+1)>>is_luma) + (b_y>>is_luma)*s->mb_stride];
             int left_intra  = IS_INTRA(s->current_picture.f.mb_type[( b_x      >> is_luma) + (b_y >> is_luma) * s->mb_stride]);
             int right_intra = IS_INTRA(s->current_picture.f.mb_type[((b_x + 1) >> is_luma) + (b_y >> is_luma) * s->mb_stride]);
-            int left_damage =  left_status&(DC_ERROR|AC_ERROR|MV_ERROR);
-            int right_damage= right_status&(DC_ERROR|AC_ERROR|MV_ERROR);
+            int left_damage =  left_status&ER_MB_ERROR;
+            int right_damage= right_status&ER_MB_ERROR;
             int offset= b_x*8 + b_y*stride*8;
             int16_t *left_mv=  s->current_picture.f.motion_val[0][mvy_stride*b_y + mvx_stride* b_x   ];
             int16_t *right_mv= s->current_picture.f.motion_val[0][mvy_stride*b_y + mvx_stride*(b_x+1)];
@@ -313,8 +313,8 @@ static void v_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int st
             int bottom_status= s->error_status_table[(b_x>>is_luma) + ((b_y+1)>>is_luma)*s->mb_stride];
             int top_intra    = IS_INTRA(s->current_picture.f.mb_type[(b_x >> is_luma) + ( b_y      >> is_luma) * s->mb_stride]);
             int bottom_intra = IS_INTRA(s->current_picture.f.mb_type[(b_x >> is_luma) + ((b_y + 1) >> is_luma) * s->mb_stride]);
-            int top_damage =      top_status&(DC_ERROR|AC_ERROR|MV_ERROR);
-            int bottom_damage= bottom_status&(DC_ERROR|AC_ERROR|MV_ERROR);
+            int top_damage =      top_status&ER_MB_ERROR;
+            int bottom_damage= bottom_status&ER_MB_ERROR;
             int offset= b_x*8 + b_y*stride*8;
             int16_t *top_mv    = s->current_picture.f.motion_val[0][mvy_stride *  b_y      + mvx_stride * b_x];
             int16_t *bottom_mv = s->current_picture.f.motion_val[0][mvy_stride * (b_y + 1) + mvx_stride * b_x];
@@ -377,7 +377,7 @@ static void guess_mv(MpegEncContext *s){
         int error= s->error_status_table[mb_xy];
 
         if(IS_INTRA(s->current_picture.f.mb_type[mb_xy])) f=MV_FROZEN; //intra //FIXME check
-        if(!(error&MV_ERROR)) f=MV_FROZEN;           //inter with undamaged MV
+        if(!(error&ER_MV_ERROR)) f=MV_FROZEN;           //inter with undamaged MV
 
         fixed[mb_xy]= f;
         if(f==MV_FROZEN)
@@ -398,7 +398,7 @@ static void guess_mv(MpegEncContext *s){
                 const int mb_xy= mb_x + mb_y*s->mb_stride;
 
                 if(IS_INTRA(s->current_picture.f.mb_type[mb_xy]))  continue;
-                if(!(s->error_status_table[mb_xy]&MV_ERROR)) continue;
+                if(!(s->error_status_table[mb_xy]&ER_MV_ERROR)) continue;
 
                 s->mv_dir = s->last_picture.f.data[0] ? MV_DIR_FORWARD : MV_DIR_BACKWARD;
                 s->mb_intra=0;
@@ -656,7 +656,7 @@ static int is_intra_more_likely(MpegEncContext *s){
     for(i=0; i<s->mb_num; i++){
         const int mb_xy= s->mb_index2xy[i];
         const int error= s->error_status_table[mb_xy];
-        if(!((error&DC_ERROR) && (error&MV_ERROR)))
+        if(!((error&ER_DC_ERROR) && (error&ER_MV_ERROR)))
             undamaged_count++;
     }
 
@@ -682,7 +682,7 @@ static int is_intra_more_likely(MpegEncContext *s){
             const int mb_xy= mb_x + mb_y*s->mb_stride;
 
             error= s->error_status_table[mb_xy];
-            if((error&DC_ERROR) && (error&MV_ERROR))
+            if((error&ER_DC_ERROR) && (error&ER_MV_ERROR))
                 continue; //skip damaged
 
             j++;
@@ -716,7 +716,7 @@ static int is_intra_more_likely(MpegEncContext *s){
 void ff_er_frame_start(MpegEncContext *s){
     if(!s->err_recognition) return;
 
-    memset(s->error_status_table, MV_ERROR|AC_ERROR|DC_ERROR|VP_START|AC_END|DC_END|MV_END, s->mb_stride*s->mb_height*sizeof(uint8_t));
+    memset(s->error_status_table, ER_MB_ERROR|VP_START|ER_MB_END, s->mb_stride*s->mb_height*sizeof(uint8_t));
     s->error_count= 3*s->mb_num;
     s->error_occurred = 0;
 }
@@ -724,7 +724,7 @@ void ff_er_frame_start(MpegEncContext *s){
 /**
  * Add a slice.
  * @param endx x component of the last macroblock, can be -1 for the last of the previous line
- * @param status the status at the end (MV_END, AC_ERROR, ...), it is assumed that no earlier end or
+ * @param status the status at the end (ER_MV_END, ER_AC_ERROR, ...), it is assumed that no earlier end or
  *               error of the same type occurred
  */
 void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int endy, int status){
@@ -745,20 +745,20 @@ void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int en
     if(!s->err_recognition) return;
 
     mask &= ~VP_START;
-    if(status & (AC_ERROR|AC_END)){
-        mask &= ~(AC_ERROR|AC_END);
+    if(status & (ER_AC_ERROR|ER_AC_END)){
+        mask &= ~(ER_AC_ERROR|ER_AC_END);
         s->error_count -= end_i - start_i + 1;
     }
-    if(status & (DC_ERROR|DC_END)){
-        mask &= ~(DC_ERROR|DC_END);
+    if(status & (ER_DC_ERROR|ER_DC_END)){
+        mask &= ~(ER_DC_ERROR|ER_DC_END);
         s->error_count -= end_i - start_i + 1;
     }
-    if(status & (MV_ERROR|MV_END)){
-        mask &= ~(MV_ERROR|MV_END);
+    if(status & (ER_MV_ERROR|ER_MV_END)){
+        mask &= ~(ER_MV_ERROR|ER_MV_END);
         s->error_count -= end_i - start_i + 1;
     }
 
-    if(status & (AC_ERROR|DC_ERROR|MV_ERROR)) {
+    if(status & ER_MB_ERROR) {
         s->error_occurred = 1;
         s->error_count= INT_MAX;
     }
@@ -785,7 +785,7 @@ void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int en
         int prev_status= s->error_status_table[ s->mb_index2xy[start_i - 1] ];
 
         prev_status &= ~ VP_START;
-        if(prev_status != (MV_END|DC_END|AC_END)) s->error_count= INT_MAX;
+        if(prev_status != (ER_MV_END|ER_DC_END|ER_AC_END)) s->error_count= INT_MAX;
     }
 }
 
@@ -858,13 +858,13 @@ void ff_er_frame_end(MpegEncContext *s){
             const int mb_xy= s->mb_index2xy[i];
             int error= s->error_status_table[mb_xy];
 
-            if(error&AC_END)
+            if(error&ER_AC_END)
                 end_ok=0;
-            if((error&MV_END) || (error&DC_END) || (error&AC_ERROR))
+            if((error&ER_MV_END) || (error&ER_DC_END) || (error&ER_AC_ERROR))
                 end_ok=1;
 
             if(!end_ok)
-                s->error_status_table[mb_xy]|= AC_ERROR;
+                s->error_status_table[mb_xy]|= ER_AC_ERROR;
 
             if(error&VP_START)
                 end_ok=0;
@@ -883,14 +883,14 @@ void ff_er_frame_end(MpegEncContext *s){
             if(error1&VP_START)
                 end_ok=1;
 
-            if(   error2==(VP_START|DC_ERROR|AC_ERROR|MV_ERROR|AC_END|DC_END|MV_END)
-               && error1!=(VP_START|DC_ERROR|AC_ERROR|MV_ERROR|AC_END|DC_END|MV_END)
-               && ((error1&AC_END) || (error1&DC_END) || (error1&MV_END))){ //end & uninit
+            if(   error2==(VP_START|ER_MB_ERROR|ER_MB_END)
+               && error1!=(VP_START|ER_MB_ERROR|ER_MB_END)
+               && ((error1&ER_AC_END) || (error1&ER_DC_END) || (error1&ER_MV_END))){ //end & uninit
                 end_ok=0;
             }
 
             if(!end_ok)
-                s->error_status_table[mb_xy]|= DC_ERROR|AC_ERROR|MV_ERROR;
+                s->error_status_table[mb_xy]|= ER_MB_ERROR;
         }
     }
 
@@ -928,9 +928,9 @@ void ff_er_frame_end(MpegEncContext *s){
         int old_error= s->error_status_table[mb_xy];
 
         if(old_error&VP_START)
-            error= old_error& (DC_ERROR|AC_ERROR|MV_ERROR);
+            error= old_error& ER_MB_ERROR;
         else{
-            error|= old_error& (DC_ERROR|AC_ERROR|MV_ERROR);
+            error|= old_error& ER_MB_ERROR;
             s->error_status_table[mb_xy]|= error;
         }
     }
@@ -940,8 +940,8 @@ void ff_er_frame_end(MpegEncContext *s){
         for(i=0; i<s->mb_num; i++){
             const int mb_xy= s->mb_index2xy[i];
             error= s->error_status_table[mb_xy];
-            if(error&(AC_ERROR|DC_ERROR|MV_ERROR))
-                error|= AC_ERROR|DC_ERROR|MV_ERROR;
+            if(error&ER_MB_ERROR)
+                error|= ER_MB_ERROR;
             s->error_status_table[mb_xy]= error;
         }
     }
@@ -951,9 +951,9 @@ void ff_er_frame_end(MpegEncContext *s){
     for(i=0; i<s->mb_num; i++){
         const int mb_xy= s->mb_index2xy[i];
         error= s->error_status_table[mb_xy];
-        if(error&DC_ERROR) dc_error ++;
-        if(error&AC_ERROR) ac_error ++;
-        if(error&MV_ERROR) mv_error ++;
+        if(error&ER_DC_ERROR) dc_error ++;
+        if(error&ER_AC_ERROR) ac_error ++;
+        if(error&ER_MV_ERROR) mv_error ++;
     }
     av_log(s->avctx, AV_LOG_INFO, "concealing %d DC, %d AC, %d MV errors\n", dc_error, ac_error, mv_error);
 
@@ -963,7 +963,7 @@ void ff_er_frame_end(MpegEncContext *s){
     for(i=0; i<s->mb_num; i++){
         const int mb_xy= s->mb_index2xy[i];
         error= s->error_status_table[mb_xy];
-        if(!((error&DC_ERROR) && (error&MV_ERROR)))
+        if(!((error&ER_DC_ERROR) && (error&ER_MV_ERROR)))
             continue;
 
         if(is_intra_likely)
@@ -989,8 +989,8 @@ void ff_er_frame_end(MpegEncContext *s){
             error= s->error_status_table[mb_xy];
 
             if(IS_INTRA(mb_type)) continue; //intra
-            if(error&MV_ERROR) continue;              //inter with damaged MV
-            if(!(error&AC_ERROR)) continue;           //undamaged inter
+            if(error&ER_MV_ERROR) continue;              //inter with damaged MV
+            if(!(error&ER_AC_ERROR)) continue;           //undamaged inter
 
             s->mv_dir = dir ? MV_DIR_BACKWARD : MV_DIR_FORWARD;
             s->mb_intra=0;
@@ -1027,8 +1027,8 @@ void ff_er_frame_end(MpegEncContext *s){
                 error= s->error_status_table[mb_xy];
 
                 if(IS_INTRA(mb_type)) continue;
-                if(!(error&MV_ERROR)) continue;           //inter with undamaged MV
-                if(!(error&AC_ERROR)) continue;           //undamaged inter
+                if(!(error&ER_MV_ERROR)) continue;           //inter with undamaged MV
+                if(!(error&ER_AC_ERROR)) continue;           //undamaged inter
 
                 s->mv_dir = MV_DIR_FORWARD|MV_DIR_BACKWARD;
                 if(!s->last_picture.f.data[0]) s->mv_dir &= ~MV_DIR_FORWARD;
@@ -1082,7 +1082,7 @@ void ff_er_frame_end(MpegEncContext *s){
             error= s->error_status_table[mb_xy];
 
             if(IS_INTRA(mb_type) && s->partitioned_frame) continue;
-//            if(error&MV_ERROR) continue; //inter data damaged FIXME is this good?
+//            if(error&ER_MV_ERROR) continue; //inter data damaged FIXME is this good?
 
             dest_y  = s->current_picture.f.data[0] + mb_x * 16 + mb_y * 16 * s->linesize;
             dest_cb = s->current_picture.f.data[1] + mb_x *  8 + mb_y *  8 * s->uvlinesize;
@@ -1132,7 +1132,7 @@ void ff_er_frame_end(MpegEncContext *s){
             error= s->error_status_table[mb_xy];
 
             if(IS_INTER(mb_type)) continue;
-            if(!(error&AC_ERROR)) continue;              //undamaged
+            if(!(error&ER_AC_ERROR)) continue;              //undamaged
 
             dest_y  = s->current_picture.f.data[0] + mb_x * 16 + mb_y * 16 * s->linesize;
             dest_cb = s->current_picture.f.data[1] + mb_x *  8 + mb_y *  8 * s->uvlinesize;
@@ -1161,7 +1161,7 @@ ec_clean:
         const int mb_xy= s->mb_index2xy[i];
         int error= s->error_status_table[mb_xy];
 
-        if(s->pict_type!=AV_PICTURE_TYPE_B && (error&(DC_ERROR|MV_ERROR|AC_ERROR))){
+        if(s->pict_type!=AV_PICTURE_TYPE_B && (error&(ER_DC_ERROR|ER_MV_ERROR|ER_AC_ERROR))){
             s->mbskip_table[mb_xy]=0;
         }
         s->mbintra_table[mb_xy]=1;

+ 8 - 8
libavcodec/h263dec.c

@@ -148,7 +148,7 @@ static int get_consumed_bytes(MpegEncContext *s, int buf_size){
 }
 
 static int decode_slice(MpegEncContext *s){
-    const int part_mask= s->partitioned_frame ? (AC_END|AC_ERROR) : 0x7F;
+    const int part_mask= s->partitioned_frame ? (ER_AC_END|ER_AC_ERROR) : 0x7F;
     const int mb_size= 16>>s->avctx->lowres;
     s->last_resync_gb= s->gb;
     s->first_slice_line= 1;
@@ -184,7 +184,7 @@ static int decode_slice(MpegEncContext *s){
         /* per-row end of slice checks */
         if(s->msmpeg4_version){
             if(s->resync_mb_y + s->slice_height == s->mb_y){
-                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_END|DC_END|MV_END);
+                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_MB_END);
 
                 return 0;
             }
@@ -225,7 +225,7 @@ static int decode_slice(MpegEncContext *s){
                         ff_h263_loop_filter(s);
 
 //printf("%d %d %d %06X\n", s->mb_x, s->mb_y, s->gb.size*8 - get_bits_count(&s->gb), show_bits(&s->gb, 24));
-                    ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
+                    ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, ER_MB_END&part_mask);
 
                     s->padding_bug_score--;
 
@@ -238,11 +238,11 @@ static int decode_slice(MpegEncContext *s){
                     return 0;
                 }else if(ret==SLICE_NOEND){
                     av_log(s->avctx, AV_LOG_ERROR, "Slice mismatch at MB: %d\n", xy);
-                    ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x+1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
+                    ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x+1, s->mb_y, ER_MB_END&part_mask);
                     return -1;
                 }
                 av_log(s->avctx, AV_LOG_ERROR, "Error at MB: %d\n", xy);
-                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
+                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, ER_MB_ERROR&part_mask);
 
                 return -1;
             }
@@ -321,7 +321,7 @@ static int decode_slice(MpegEncContext *s){
         else if(left<0){
             av_log(s->avctx, AV_LOG_ERROR, "overreading %d bits\n", -left);
         }else
-            ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_END|DC_END|MV_END);
+            ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_MB_END);
 
         return 0;
     }
@@ -330,7 +330,7 @@ static int decode_slice(MpegEncContext *s){
             get_bits_left(&s->gb),
             show_bits(&s->gb, 24), s->padding_bug_score);
 
-    ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
+    ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, ER_MB_END&part_mask);
 
     return -1;
 }
@@ -673,7 +673,7 @@ retry:
 
     if (s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type==AV_PICTURE_TYPE_I)
         if(!CONFIG_MSMPEG4_DECODER || msmpeg4_decode_ext_header(s, buf_size) < 0){
-            s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR;
+            s->error_status_table[s->mb_num-1]= ER_MB_ERROR;
         }
 
     assert(s->bitstream_buffer_size==0);

+ 9 - 9
libavcodec/h264.c

@@ -3593,7 +3593,7 @@ static void decode_finish_row(H264Context *h){
 static int decode_slice(struct AVCodecContext *avctx, void *arg){
     H264Context *h = *(void**)arg;
     MpegEncContext * const s = &h->s;
-    const int part_mask= s->partitioned_frame ? (AC_END|AC_ERROR) : 0x7F;
+    const int part_mask= s->partitioned_frame ? (ER_AC_END|ER_AC_ERROR) : 0x7F;
     int lf_x_start = s->mb_x;
 
     s->mb_skip_run= -1;
@@ -3632,13 +3632,13 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){
             eos = get_cabac_terminate( &h->cabac );
 
             if((s->workaround_bugs & FF_BUG_TRUNCATED) && h->cabac.bytestream > h->cabac.bytestream_end + 2){
-                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
+                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_MB_END&part_mask);
                 if (s->mb_x >= lf_x_start) loop_filter(h, lf_x_start, s->mb_x + 1);
                 return 0;
             }
             if( ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 2) {
                 av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding MB %d %d, bytestream (%td)\n", s->mb_x, s->mb_y, h->cabac.bytestream_end - h->cabac.bytestream);
-                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
+                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, ER_MB_ERROR&part_mask);
                 return -1;
             }
 
@@ -3656,7 +3656,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){
 
             if( eos || s->mb_y >= s->mb_height ) {
                 tprintf(s->avctx, "slice end %d %d\n", get_bits_count(&s->gb), s->gb.size_in_bits);
-                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
+                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_MB_END&part_mask);
                 if (s->mb_x > lf_x_start) loop_filter(h, lf_x_start, s->mb_x);
                 return 0;
             }
@@ -3678,7 +3678,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){
 
             if(ret<0){
                 av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding MB %d %d\n", s->mb_x, s->mb_y);
-                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
+                ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, ER_MB_ERROR&part_mask);
                 return -1;
             }
 
@@ -3697,11 +3697,11 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){
 
                     if(   get_bits_count(&s->gb) == s->gb.size_in_bits
                        || get_bits_count(&s->gb) <  s->gb.size_in_bits && s->avctx->error_recognition < FF_ER_AGGRESSIVE) {
-                        ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
+                        ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_MB_END&part_mask);
 
                         return 0;
                     }else{
-                        ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
+                        ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, ER_MB_END&part_mask);
 
                         return -1;
                     }
@@ -3711,12 +3711,12 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){
             if(get_bits_count(&s->gb) >= s->gb.size_in_bits && s->mb_skip_run<=0){
                 tprintf(s->avctx, "slice end %d %d\n", get_bits_count(&s->gb), s->gb.size_in_bits);
                 if(get_bits_count(&s->gb) == s->gb.size_in_bits ){
-                    ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
+                    ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_MB_END&part_mask);
                     if (s->mb_x > lf_x_start) loop_filter(h, lf_x_start, s->mb_x);
 
                     return 0;
                 }else{
-                    ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
+                    ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, ER_MB_ERROR&part_mask);
 
                     return -1;
                 }

+ 2 - 2
libavcodec/h264.h

@@ -690,13 +690,13 @@ av_cold void ff_h264_decode_init_vlc(void);
 
 /**
  * Decode a macroblock
- * @return 0 if OK, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed
+ * @return 0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR if an error is noticed
  */
 int ff_h264_decode_mb_cavlc(H264Context *h);
 
 /**
  * Decode a CABAC coded macroblock
- * @return 0 if OK, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed
+ * @return 0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR if an error is noticed
  */
 int ff_h264_decode_mb_cabac(H264Context *h);
 

+ 1 - 1
libavcodec/h264_cabac.c

@@ -1864,7 +1864,7 @@ static av_always_inline void decode_cabac_luma_residual( H264Context *h, const u
 
 /**
  * Decode a macroblock.
- * @return 0 if OK, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed
+ * @return 0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR if an error is noticed
  */
 int ff_h264_decode_mb_cabac(H264Context *h) {
     MpegEncContext * const s = &h->s;

Some files were not shown because too many files changed in this diff