Skip to content

Commit

Permalink
4:4:4 H.264 decoding support
Browse files Browse the repository at this point in the history
Note: this is 4:4:4 from the 2007 spec revision, not the previous (now deprecated) 4:4:4 mode in H.264.
  • Loading branch information
Jason Garrett-Glaser committed Jun 14, 2011
1 parent 99477ad commit c90b944
Show file tree
Hide file tree
Showing 18 changed files with 1,608 additions and 646 deletions.
3 changes: 2 additions & 1 deletion libavcodec/arm/h264dsp_init_arm.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth)
c->h264_idct_dc_add = ff_h264_idct_dc_add_neon; c->h264_idct_dc_add = ff_h264_idct_dc_add_neon;
c->h264_idct_add16 = ff_h264_idct_add16_neon; c->h264_idct_add16 = ff_h264_idct_add16_neon;
c->h264_idct_add16intra = ff_h264_idct_add16intra_neon; c->h264_idct_add16intra = ff_h264_idct_add16intra_neon;
c->h264_idct_add8 = ff_h264_idct_add8_neon; //FIXME: reenable when asm is updated.
//c->h264_idct_add8 = ff_h264_idct_add8_neon;
c->h264_idct8_add = ff_h264_idct8_add_neon; c->h264_idct8_add = ff_h264_idct8_add_neon;
c->h264_idct8_dc_add = ff_h264_idct8_dc_add_neon; c->h264_idct8_dc_add = ff_h264_idct8_dc_add_neon;
c->h264_idct8_add4 = ff_h264_idct8_add4_neon; c->h264_idct8_add4 = ff_h264_idct8_add4_neon;
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/dsputil.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ typedef struct DSPContext {
#define BASIS_SHIFT 16 #define BASIS_SHIFT 16
#define RECON_SHIFT 6 #define RECON_SHIFT 6


void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w, int sides); void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w, int h, int sides);
#define EDGE_WIDTH 16 #define EDGE_WIDTH 16
#define EDGE_TOP 1 #define EDGE_TOP 1
#define EDGE_BOTTOM 2 #define EDGE_BOTTOM 2
Expand Down
6 changes: 3 additions & 3 deletions libavcodec/dsputil_template.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static inline void FUNC(copy_block16)(uint8_t *dst, const uint8_t *src, int dstS


/* draw the edges of width 'w' of an image of size width, height */ /* draw the edges of width 'w' of an image of size width, height */
//FIXME check that this is ok for mpeg4 interlaced //FIXME check that this is ok for mpeg4 interlaced
static void FUNCC(draw_edges)(uint8_t *_buf, int _wrap, int width, int height, int w, int sides) static void FUNCC(draw_edges)(uint8_t *_buf, int _wrap, int width, int height, int w, int h, int sides)
{ {
pixel *buf = (pixel*)_buf; pixel *buf = (pixel*)_buf;
int wrap = _wrap / sizeof(pixel); int wrap = _wrap / sizeof(pixel);
Expand All @@ -106,10 +106,10 @@ static void FUNCC(draw_edges)(uint8_t *_buf, int _wrap, int width, int height, i
buf -= w; buf -= w;
last_line = buf + (height - 1) * wrap; last_line = buf + (height - 1) * wrap;
if (sides & EDGE_TOP) if (sides & EDGE_TOP)
for(i = 0; i < w; i++) for(i = 0; i < h; i++)
memcpy(buf - (i + 1) * wrap, buf, (width + w + w) * sizeof(pixel)); // top memcpy(buf - (i + 1) * wrap, buf, (width + w + w) * sizeof(pixel)); // top
if (sides & EDGE_BOTTOM) if (sides & EDGE_BOTTOM)
for (i = 0; i < w; i++) for (i = 0; i < h; i++)
memcpy(last_line + (i + 1) * wrap, last_line, (width + w + w) * sizeof(pixel)); // bottom memcpy(last_line + (i + 1) * wrap, last_line, (width + w + w) * sizeof(pixel)); // bottom
} }


Expand Down
762 changes: 498 additions & 264 deletions libavcodec/h264.c

Large diffs are not rendered by default.

181 changes: 100 additions & 81 deletions libavcodec/h264.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
#define interlaced_dct interlaced_dct_is_a_bad_name #define interlaced_dct interlaced_dct_is_a_bad_name
#define mb_intra mb_intra_is_not_initialized_see_mb_type #define mb_intra mb_intra_is_not_initialized_see_mb_type


#define LUMA_DC_BLOCK_INDEX 24
#define CHROMA_DC_BLOCK_INDEX 25

#define CHROMA_DC_COEFF_TOKEN_VLC_BITS 8 #define CHROMA_DC_COEFF_TOKEN_VLC_BITS 8
#define COEFF_TOKEN_VLC_BITS 8 #define COEFF_TOKEN_VLC_BITS 8
#define TOTAL_ZEROS_VLC_BITS 9 #define TOTAL_ZEROS_VLC_BITS 9
Expand All @@ -60,8 +57,6 @@
* of progressive decoding by about 2%. */ * of progressive decoding by about 2%. */
#define ALLOW_INTERLACE #define ALLOW_INTERLACE


#define ALLOW_NOCHROMA

#define FMO 0 #define FMO 0


/** /**
Expand All @@ -85,16 +80,12 @@
#endif #endif
#define FIELD_OR_MBAFF_PICTURE (FRAME_MBAFF || FIELD_PICTURE) #define FIELD_OR_MBAFF_PICTURE (FRAME_MBAFF || FIELD_PICTURE)


#ifdef ALLOW_NOCHROMA
#define CHROMA h->sps.chroma_format_idc
#else
#define CHROMA 1
#endif

#ifndef CABAC #ifndef CABAC
#define CABAC h->pps.cabac #define CABAC h->pps.cabac
#endif #endif


#define CHROMA444 (h->sps.chroma_format_idc == 3)

#define EXTENDED_SAR 255 #define EXTENDED_SAR 255


#define MB_TYPE_REF0 MB_TYPE_ACPRED //dirty but it fits in 16 bit #define MB_TYPE_REF0 MB_TYPE_ACPRED //dirty but it fits in 16 bit
Expand Down Expand Up @@ -198,7 +189,7 @@ typedef struct SPS{
int num_reorder_frames; int num_reorder_frames;
int scaling_matrix_present; int scaling_matrix_present;
uint8_t scaling_matrix4[6][16]; uint8_t scaling_matrix4[6][16];
uint8_t scaling_matrix8[2][64]; uint8_t scaling_matrix8[6][64];
int nal_hrd_parameters_present_flag; int nal_hrd_parameters_present_flag;
int vcl_hrd_parameters_present_flag; int vcl_hrd_parameters_present_flag;
int pic_struct_present_flag; int pic_struct_present_flag;
Expand Down Expand Up @@ -233,7 +224,7 @@ typedef struct PPS{
int redundant_pic_cnt_present; ///< redundant_pic_cnt_present_flag int redundant_pic_cnt_present; ///< redundant_pic_cnt_present_flag
int transform_8x8_mode; ///< transform_8x8_mode_flag int transform_8x8_mode; ///< transform_8x8_mode_flag
uint8_t scaling_matrix4[6][16]; uint8_t scaling_matrix4[6][16];
uint8_t scaling_matrix8[2][64]; uint8_t scaling_matrix8[6][64];
uint8_t chroma_qp_table[2][64]; ///< pre-scaled (with chroma_qp_index_offset) version of qp_table uint8_t chroma_qp_table[2][64]; ///< pre-scaled (with chroma_qp_index_offset) version of qp_table
int chroma_qp_diff; int chroma_qp_diff;
}PPS; }PPS;
Expand Down Expand Up @@ -298,21 +289,15 @@ typedef struct H264Context{
unsigned int top_samples_available; unsigned int top_samples_available;
unsigned int topright_samples_available; unsigned int topright_samples_available;
unsigned int left_samples_available; unsigned int left_samples_available;
uint8_t (*top_borders[2])[(16+2*8)*2]; uint8_t (*top_borders[2])[(16*3)*2];


/** /**
* non zero coeff count cache. * non zero coeff count cache.
* is 64 if not available. * is 64 if not available.
*/ */
DECLARE_ALIGNED(8, uint8_t, non_zero_count_cache)[6*8]; DECLARE_ALIGNED(8, uint8_t, non_zero_count_cache)[15*8];


/* uint8_t (*non_zero_count)[48];
.UU.YYYY
.UU.YYYY
.vv.YYYY
.VV.YYYY
*/
uint8_t (*non_zero_count)[32];


/** /**
* Motion vector cache. * Motion vector cache.
Expand All @@ -336,7 +321,7 @@ typedef struct H264Context{
* block_offset[ 0..23] for frame macroblocks * block_offset[ 0..23] for frame macroblocks
* block_offset[24..47] for field macroblocks * block_offset[24..47] for field macroblocks
*/ */
int block_offset[2*(16+8)]; int block_offset[2*(16*3)];


uint32_t *mb2b_xy; //FIXME are these 4 a good idea? uint32_t *mb2b_xy; //FIXME are these 4 a good idea?
uint32_t *mb2br_xy; uint32_t *mb2br_xy;
Expand All @@ -356,9 +341,9 @@ typedef struct H264Context{
PPS pps; //FIXME move to Picture perhaps? (->no) do we need that? PPS pps; //FIXME move to Picture perhaps? (->no) do we need that?


uint32_t dequant4_buffer[6][QP_MAX_NUM+1][16]; //FIXME should these be moved down? uint32_t dequant4_buffer[6][QP_MAX_NUM+1][16]; //FIXME should these be moved down?
uint32_t dequant8_buffer[2][QP_MAX_NUM+1][64]; uint32_t dequant8_buffer[6][QP_MAX_NUM+1][64];
uint32_t (*dequant4_coeff[6])[16]; uint32_t (*dequant4_coeff[6])[16];
uint32_t (*dequant8_coeff[2])[64]; uint32_t (*dequant8_coeff[6])[64];


int slice_num; int slice_num;
uint16_t *slice_table; ///< slice_table_base + 2*mb_stride + 1 uint16_t *slice_table; ///< slice_table_base + 2*mb_stride + 1
Expand Down Expand Up @@ -408,15 +393,15 @@ typedef struct H264Context{
GetBitContext *intra_gb_ptr; GetBitContext *intra_gb_ptr;
GetBitContext *inter_gb_ptr; GetBitContext *inter_gb_ptr;


DECLARE_ALIGNED(16, DCTELEM, mb)[16*24*2]; ///< as a dct coeffecient is int32_t in high depth, we need to reserve twice the space. DECLARE_ALIGNED(16, DCTELEM, mb)[16*48*2]; ///< as a dct coeffecient is int32_t in high depth, we need to reserve twice the space.
DECLARE_ALIGNED(16, DCTELEM, mb_luma_dc)[16*2]; DECLARE_ALIGNED(16, DCTELEM, mb_luma_dc)[3][16*2];
DCTELEM mb_padding[256*2]; ///< as mb is addressed by scantable[i] and scantable is uint8_t we can either check that i is not too large or ensure that there is some unused stuff after mb DCTELEM mb_padding[256*2]; ///< as mb is addressed by scantable[i] and scantable is uint8_t we can either check that i is not too large or ensure that there is some unused stuff after mb


/** /**
* Cabac * Cabac
*/ */
CABACContext cabac; CABACContext cabac;
uint8_t cabac_state[460]; uint8_t cabac_state[1024];


/* 0x100 -> non null luma_dc, 0x80/0x40 -> non null chroma_dc (cb/cr), 0x?0 -> chroma_cbp(0,1,2), 0x0? luma_cbp */ /* 0x100 -> non null luma_dc, 0x80/0x40 -> non null chroma_dc (cb/cr), 0x?0 -> chroma_cbp(0,1,2), 0x0? luma_cbp */
uint16_t *cbp_table; uint16_t *cbp_table;
Expand Down Expand Up @@ -721,27 +706,43 @@ o-o o-o
*/ */


/* Scan8 organization: /* Scan8 organization:
* 0 1 2 3 4 5 6 7 * 0 1 2 3 4 5 6 7
* 0 u u y y y y y * 0 DY y y y y y
* 1 u U U y Y Y Y Y * 1 y Y Y Y Y
* 2 u U U y Y Y Y Y * 2 y Y Y Y Y
* 3 v v y Y Y Y Y * 3 y Y Y Y Y
* 4 v V V y Y Y Y Y * 4 y Y Y Y Y
* 5 v V V DYDUDV * 5 DU u u u u u
* 6 u U U U U
* 7 u U U U U
* 8 u U U U U
* 9 u U U U U
* 10 DV v v v v v
* 11 v V V V V
* 12 v V V V V
* 13 v V V V V
* 14 v V V V V
* DY/DU/DV are for luma/chroma DC. * DY/DU/DV are for luma/chroma DC.
*/ */


#define LUMA_DC_BLOCK_INDEX 48
#define CHROMA_DC_BLOCK_INDEX 49

//This table must be here because scan8[constant] must be known at compiletime //This table must be here because scan8[constant] must be known at compiletime
static const uint8_t scan8[16 + 2*4 + 3]={ static const uint8_t scan8[16*3 + 3]={
4+1*8, 5+1*8, 4+2*8, 5+2*8, 4+ 1*8, 5+ 1*8, 4+ 2*8, 5+ 2*8,
6+1*8, 7+1*8, 6+2*8, 7+2*8, 6+ 1*8, 7+ 1*8, 6+ 2*8, 7+ 2*8,
4+3*8, 5+3*8, 4+4*8, 5+4*8, 4+ 3*8, 5+ 3*8, 4+ 4*8, 5+ 4*8,
6+3*8, 7+3*8, 6+4*8, 7+4*8, 6+ 3*8, 7+ 3*8, 6+ 4*8, 7+ 4*8,
1+1*8, 2+1*8, 4+ 6*8, 5+ 6*8, 4+ 7*8, 5+ 7*8,
1+2*8, 2+2*8, 6+ 6*8, 7+ 6*8, 6+ 7*8, 7+ 7*8,
1+4*8, 2+4*8, 4+ 8*8, 5+ 8*8, 4+ 9*8, 5+ 9*8,
1+5*8, 2+5*8, 6+ 8*8, 7+ 8*8, 6+ 9*8, 7+ 9*8,
4+5*8, 5+5*8, 6+5*8 4+11*8, 5+11*8, 4+12*8, 5+12*8,
6+11*8, 7+11*8, 6+12*8, 7+12*8,
4+13*8, 5+13*8, 4+14*8, 5+14*8,
6+13*8, 7+13*8, 6+14*8, 7+14*8,
0+ 0*8, 0+ 5*8, 0+10*8
}; };


static av_always_inline uint32_t pack16to32(int a, int b){ static av_always_inline uint32_t pack16to32(int a, int b){
Expand Down Expand Up @@ -773,11 +774,11 @@ static void fill_decode_neighbors(H264Context *h, int mb_type){
MpegEncContext * const s = &h->s; MpegEncContext * const s = &h->s;
const int mb_xy= h->mb_xy; const int mb_xy= h->mb_xy;
int topleft_xy, top_xy, topright_xy, left_xy[2]; int topleft_xy, top_xy, topright_xy, left_xy[2];
static const uint8_t left_block_options[4][16]={ static const uint8_t left_block_options[4][32]={
{0,1,2,3,7,10,8,11,7+0*8, 7+1*8, 7+2*8, 7+3*8, 2+0*8, 2+3*8, 2+1*8, 2+2*8}, {0,1,2,3,7,10,8,11,3+0*4, 3+1*4, 3+2*4, 3+3*4, 1+4*4, 1+8*4, 1+5*4, 1+9*4},
{2,2,3,3,8,11,8,11,7+2*8, 7+2*8, 7+3*8, 7+3*8, 2+1*8, 2+2*8, 2+1*8, 2+2*8}, {2,2,3,3,8,11,8,11,3+2*4, 3+2*4, 3+3*4, 3+3*4, 1+5*4, 1+9*4, 1+5*4, 1+9*4},
{0,0,1,1,7,10,7,10,7+0*8, 7+0*8, 7+1*8, 7+1*8, 2+0*8, 2+3*8, 2+0*8, 2+3*8}, {0,0,1,1,7,10,7,10,3+0*4, 3+0*4, 3+1*4, 3+1*4, 1+4*4, 1+8*4, 1+4*4, 1+8*4},
{0,2,0,2,7,10,7,10,7+0*8, 7+2*8, 7+0*8, 7+2*8, 2+0*8, 2+3*8, 2+0*8, 2+3*8} {0,2,0,2,7,10,7,10,3+0*4, 3+2*4, 3+0*4, 3+2*4, 1+4*4, 1+8*4, 1+4*4, 1+8*4}
}; };


h->topleft_partition= -1; h->topleft_partition= -1;
Expand Down Expand Up @@ -947,32 +948,41 @@ static void fill_decode_caches(H264Context *h, int mb_type){
*/ */
//FIXME constraint_intra_pred & partitioning & nnz (let us hope this is just a typo in the spec) //FIXME constraint_intra_pred & partitioning & nnz (let us hope this is just a typo in the spec)
if(top_type){ if(top_type){
AV_COPY32(&h->non_zero_count_cache[4+8*0], &h->non_zero_count[top_xy][4+3*8]); AV_COPY32(&h->non_zero_count_cache[4+8* 0], &h->non_zero_count[top_xy][4*3]);
h->non_zero_count_cache[1+8*0]= h->non_zero_count[top_xy][1+1*8]; if(CHROMA444){
h->non_zero_count_cache[2+8*0]= h->non_zero_count[top_xy][2+1*8]; AV_COPY32(&h->non_zero_count_cache[4+8* 5], &h->non_zero_count[top_xy][4* 7]);

AV_COPY32(&h->non_zero_count_cache[4+8*10], &h->non_zero_count[top_xy][4*11]);
h->non_zero_count_cache[1+8*3]= h->non_zero_count[top_xy][1+2*8]; }else{
h->non_zero_count_cache[2+8*3]= h->non_zero_count[top_xy][2+2*8]; AV_COPY32(&h->non_zero_count_cache[4+8* 5], &h->non_zero_count[top_xy][4* 5]);
}else { AV_COPY32(&h->non_zero_count_cache[4+8*10], &h->non_zero_count[top_xy][4* 9]);
h->non_zero_count_cache[1+8*0]= }
h->non_zero_count_cache[2+8*0]= }else{

uint32_t top_empty = CABAC && !IS_INTRA(mb_type) ? 0 : 0x40404040;
h->non_zero_count_cache[1+8*3]= AV_WN32A(&h->non_zero_count_cache[4+8* 0], top_empty);
h->non_zero_count_cache[2+8*3]= AV_WN32A(&h->non_zero_count_cache[4+8* 5], top_empty);
AV_WN32A(&h->non_zero_count_cache[4+8*0], CABAC && !IS_INTRA(mb_type) ? 0 : 0x40404040); AV_WN32A(&h->non_zero_count_cache[4+8*10], top_empty);
} }


for (i=0; i<2; i++) { for (i=0; i<2; i++) {
if(left_type[i]){ if(left_type[i]){
h->non_zero_count_cache[3+8*1 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+0+2*i]]; h->non_zero_count_cache[3+8* 1 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+0+2*i]];
h->non_zero_count_cache[3+8*2 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+1+2*i]]; h->non_zero_count_cache[3+8* 2 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+1+2*i]];
h->non_zero_count_cache[0+8*1 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+4+2*i]]; if(CHROMA444){
h->non_zero_count_cache[0+8*4 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+5+2*i]]; h->non_zero_count_cache[3+8* 6 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+0+2*i]+4*4];
h->non_zero_count_cache[3+8* 7 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+1+2*i]+4*4];
h->non_zero_count_cache[3+8*11 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+0+2*i]+8*4];
h->non_zero_count_cache[3+8*12 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+1+2*i]+8*4];
}else{
h->non_zero_count_cache[3+8* 6 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+4+2*i]];
h->non_zero_count_cache[3+8*11 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+5+2*i]];
}
}else{ }else{
h->non_zero_count_cache[3+8*1 + 2*8*i]= h->non_zero_count_cache[3+8* 1 + 2*8*i]=
h->non_zero_count_cache[3+8*2 + 2*8*i]= h->non_zero_count_cache[3+8* 2 + 2*8*i]=
h->non_zero_count_cache[0+8*1 + 8*i]= h->non_zero_count_cache[3+8* 6 + 2*8*i]=
h->non_zero_count_cache[0+8*4 + 8*i]= CABAC && !IS_INTRA(mb_type) ? 0 : 64; h->non_zero_count_cache[3+8* 7 + 2*8*i]=
h->non_zero_count_cache[3+8*11 + 2*8*i]=
h->non_zero_count_cache[3+8*12 + 2*8*i]= CABAC && !IS_INTRA(mb_type) ? 0 : 64;
} }
} }


Expand All @@ -981,15 +991,15 @@ static void fill_decode_caches(H264Context *h, int mb_type){
if(top_type) { if(top_type) {
h->top_cbp = h->cbp_table[top_xy]; h->top_cbp = h->cbp_table[top_xy];
} else { } else {
h->top_cbp = IS_INTRA(mb_type) ? 0x1CF : 0x00F; h->top_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F;
} }
// left_cbp // left_cbp
if (left_type[0]) { if (left_type[0]) {
h->left_cbp = (h->cbp_table[left_xy[0]] & 0x1f0) h->left_cbp = (h->cbp_table[left_xy[0]] & 0x7F0)
| ((h->cbp_table[left_xy[0]]>>(left_block[0]&(~1)))&2) | ((h->cbp_table[left_xy[0]]>>(left_block[0]&(~1)))&2)
| (((h->cbp_table[left_xy[1]]>>(left_block[2]&(~1)))&2) << 2); | (((h->cbp_table[left_xy[1]]>>(left_block[2]&(~1)))&2) << 2);
} else { } else {
h->left_cbp = IS_INTRA(mb_type) ? 0x1CF : 0x00F; h->left_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F;
} }
} }
} }
Expand Down Expand Up @@ -1190,11 +1200,21 @@ static inline int pred_intra_mode(H264Context *h, int n){
static inline void write_back_non_zero_count(H264Context *h){ static inline void write_back_non_zero_count(H264Context *h){
const int mb_xy= h->mb_xy; const int mb_xy= h->mb_xy;


AV_COPY64(&h->non_zero_count[mb_xy][ 0], &h->non_zero_count_cache[0+8*1]); AV_COPY32(&h->non_zero_count[mb_xy][ 0], &h->non_zero_count_cache[4+8* 1]);
AV_COPY64(&h->non_zero_count[mb_xy][ 8], &h->non_zero_count_cache[0+8*2]); AV_COPY32(&h->non_zero_count[mb_xy][ 4], &h->non_zero_count_cache[4+8* 2]);
AV_COPY32(&h->non_zero_count[mb_xy][16], &h->non_zero_count_cache[0+8*5]); AV_COPY32(&h->non_zero_count[mb_xy][ 8], &h->non_zero_count_cache[4+8* 3]);
AV_COPY32(&h->non_zero_count[mb_xy][20], &h->non_zero_count_cache[4+8*3]); AV_COPY32(&h->non_zero_count[mb_xy][12], &h->non_zero_count_cache[4+8* 4]);
AV_COPY64(&h->non_zero_count[mb_xy][24], &h->non_zero_count_cache[0+8*4]); AV_COPY32(&h->non_zero_count[mb_xy][16], &h->non_zero_count_cache[4+8* 6]);
AV_COPY32(&h->non_zero_count[mb_xy][20], &h->non_zero_count_cache[4+8* 7]);
AV_COPY32(&h->non_zero_count[mb_xy][32], &h->non_zero_count_cache[4+8*11]);
AV_COPY32(&h->non_zero_count[mb_xy][36], &h->non_zero_count_cache[4+8*12]);

if(CHROMA444){
AV_COPY32(&h->non_zero_count[mb_xy][24], &h->non_zero_count_cache[4+8* 8]);
AV_COPY32(&h->non_zero_count[mb_xy][28], &h->non_zero_count_cache[4+8* 9]);
AV_COPY32(&h->non_zero_count[mb_xy][40], &h->non_zero_count_cache[4+8*13]);
AV_COPY32(&h->non_zero_count[mb_xy][44], &h->non_zero_count_cache[4+8*14]);
}
} }


static inline void write_back_motion(H264Context *h, int mb_type){ static inline void write_back_motion(H264Context *h, int mb_type){
Expand Down Expand Up @@ -1267,8 +1287,7 @@ static void av_unused decode_mb_skip(H264Context *h){
const int mb_xy= h->mb_xy; const int mb_xy= h->mb_xy;
int mb_type=0; int mb_type=0;


memset(h->non_zero_count[mb_xy], 0, 32); memset(h->non_zero_count[mb_xy], 0, 48);
memset(h->non_zero_count_cache + 8, 0, 8*5); //FIXME ugly, remove pfui


if(MB_FIELD) if(MB_FIELD)
mb_type|= MB_TYPE_INTERLACED; mb_type|= MB_TYPE_INTERLACED;
Expand Down
Loading

0 comments on commit c90b944

Please sign in to comment.