--- libavcodec/mpeg12.c | 224 +++++++++++++++++++++++++------------------------- 1 files changed, 112 insertions(+), 112 deletions(-)
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 574f69a..a85d3ca 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -91,31 +91,31 @@ static void init_2d_vlc_rl(RLTable *rl) int i; for(i=0; i<rl->vlc.table_size; i++){ - int code= rl->vlc.table[i][0]; + int code = rl->vlc.table[i][0]; int len = rl->vlc.table[i][1]; int level, run; if(len==0){ // illegal code - run= 65; - level= MAX_LEVEL; + run = 65; + level = MAX_LEVEL; }else if(len<0){ //more bits needed - run= 0; - level= code; + run = 0; + level = code; }else{ if(code==rl->n){ //esc - run= 65; - level= 0; + run = 65; + level = 0; }else if(code==rl->n+1){ //eob - run= 0; - level= 127; + run = 0; + level = 127; }else{ run= rl->table_run [code] + 1; - level= rl->table_level[code]; + level = rl->table_level[code]; } } - rl->rl_vlc[0][i].len= len; - rl->rl_vlc[0][i].level= level; - rl->rl_vlc[0][i].run= run; + rl->rl_vlc[0][i].len = len; + rl->rl_vlc[0][i].level = level; + rl->rl_vlc[0][i].run = run; } } @@ -123,7 +123,7 @@ void ff_mpeg12_common_init(MpegEncContext *s) { s->y_dc_scale_table= - s->c_dc_scale_table= ff_mpeg2_dc_scale_table[s->intra_dc_precision]; + s->c_dc_scale_table = ff_mpeg2_dc_scale_table[s->intra_dc_precision]; } @@ -452,7 +452,7 @@ static int mpeg_decode_mb(MpegEncContext *s, for(i=0;i<2;i++) { if (USES_LIST(mb_type, i)) { int dmx, dmy, mx, my, m; - const int my_shift= s->picture_structure == PICT_FRAME; + const int my_shift = s->picture_structure == PICT_FRAME; mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0], s->last_mv[i][0][0]); @@ -608,7 +608,7 @@ static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred) val += pred; /* modulo decoding */ - l= INT_BIT - 5 - shift; + l = INT_BIT - 5 - shift; val = (val<<l)>>l; return val; } @@ -620,9 +620,9 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s, int level, dc, diff, i, j, run; int component; RLTable *rl = &ff_rl_mpeg1; - uint8_t * const scantable= s->intra_scantable.permutated; - const uint16_t *quant_matrix= s->intra_matrix; - const int qscale= s->qscale; + uint8_t * const scantable = s->intra_scantable.permutated; + const uint16_t *quant_matrix = s->intra_matrix; + const int qscale = s->qscale; /* DC coefficient */ component = (n <= 3 ? 0 : n - 4 + 1); @@ -699,9 +699,9 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s, { int level, i, j, run; RLTable *rl = &ff_rl_mpeg1; - uint8_t * const scantable= s->intra_scantable.permutated; - const uint16_t *quant_matrix= s->inter_matrix; - const int qscale= s->qscale; + uint8_t * const scantable = s->intra_scantable.permutated; + const uint16_t *quant_matrix = s->inter_matrix; + const int qscale = s->qscale; { OPEN_READER(re, &s->gb); @@ -774,8 +774,8 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *bloc { int level, i, j, run; RLTable *rl = &ff_rl_mpeg1; - uint8_t * const scantable= s->intra_scantable.permutated; - const int qscale= s->qscale; + uint8_t * const scantable = s->intra_scantable.permutated; + const int qscale = s->qscale; { OPEN_READER(re, &s->gb); @@ -848,9 +848,9 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, { int level, i, j, run; RLTable *rl = &ff_rl_mpeg1; - uint8_t * const scantable= s->intra_scantable.permutated; + uint8_t * const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; - const int qscale= s->qscale; + const int qscale = s->qscale; int mismatch; mismatch = 1; @@ -929,8 +929,8 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, { int level, i, j, run; RLTable *rl = &ff_rl_mpeg1; - uint8_t * const scantable= s->intra_scantable.permutated; - const int qscale= s->qscale; + uint8_t * const scantable = s->intra_scantable.permutated; + const int qscale = s->qscale; OPEN_READER(re, &s->gb); i = -1; @@ -993,9 +993,9 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, int level, dc, diff, i, j, run; int component; RLTable *rl; - uint8_t * const scantable= s->intra_scantable.permutated; + uint8_t * const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; - const int qscale= s->qscale; + const int qscale = s->qscale; int mismatch; /* DC coefficient */ @@ -1073,9 +1073,9 @@ static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, int level, dc, diff, j, run; int component; RLTable *rl; - uint8_t * scantable= s->intra_scantable.permutated; + uint8_t * scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; - const int qscale= s->qscale; + const int qscale = s->qscale; /* DC coefficient */ if (n < 4){ @@ -1162,17 +1162,17 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx) MPV_decode_defaults(s2); - s->mpeg_enc_ctx.avctx= avctx; - s->mpeg_enc_ctx.flags= avctx->flags; - s->mpeg_enc_ctx.flags2= avctx->flags2; + s->mpeg_enc_ctx.avctx = avctx; + s->mpeg_enc_ctx.flags = avctx->flags; + s->mpeg_enc_ctx.flags2 = avctx->flags2; ff_mpeg12_common_init(&s->mpeg_enc_ctx); ff_mpeg12_init_vlcs(); s->mpeg_enc_ctx_allocated = 0; s->mpeg_enc_ctx.picture_number = 0; s->repeat_field = 0; - s->mpeg_enc_ctx.codec_id= avctx->codec->id; - avctx->color_range= AVCOL_RANGE_MPEG; + s->mpeg_enc_ctx.codec_id = avctx->codec->id; + avctx->color_range = AVCOL_RANGE_MPEG; if (avctx->codec->id == CODEC_ID_MPEG1VIDEO) avctx->chroma_sample_location = AVCHROMA_LOC_CENTER; else @@ -1253,10 +1253,10 @@ static int mpeg_decode_postinit(AVCodecContext *avctx){ { if (s1->mpeg_enc_ctx_allocated) { - ParseContext pc= s->parse_context; + ParseContext pc = s->parse_context; s->parse_context.buffer=0; MPV_common_end(s); - s->parse_context= pc; + s->parse_context = pc; } if( (s->width == 0 )||(s->height == 0)) @@ -1276,10 +1276,10 @@ static int mpeg_decode_postinit(AVCodecContext *avctx){ assert((avctx->sub_id==1) == (avctx->codec_id==CODEC_ID_MPEG1VIDEO)); if(avctx->codec_id==CODEC_ID_MPEG1VIDEO){ //MPEG-1 fps - avctx->time_base.den= ff_frame_rate_tab[s->frame_rate_index].num; - avctx->time_base.num= ff_frame_rate_tab[s->frame_rate_index].den; + avctx->time_base.den = ff_frame_rate_tab[s->frame_rate_index].num; + avctx->time_base.num = ff_frame_rate_tab[s->frame_rate_index].den; //MPEG-1 aspect - avctx->sample_aspect_ratio= av_d2q( + avctx->sample_aspect_ratio = av_d2q( 1.0/ff_mpeg1_aspect[s->aspect_ratio_info], 255); avctx->ticks_per_frame=1; }else{//MPEG-2 @@ -1318,7 +1318,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx){ //issue1613 4/3 16/9 -> 16/9 //res_change_ffmpeg_aspect.ts 4/3 225/44 ->4/3 //widescreen-issue562.mpg 4/3 16/9 -> 16/9 -// s->avctx->sample_aspect_ratio= av_mul_q(s->avctx->sample_aspect_ratio, (AVRational){s->width, s->height}); +// s->avctx->sample_aspect_ratio = av_mul_q(s->avctx->sample_aspect_ratio, (AVRational){s->width, s->height}); //av_log(NULL, AV_LOG_ERROR, "A %d/%d\n",ff_mpeg2_aspect[s->aspect_ratio_info].num, ff_mpeg2_aspect[s->aspect_ratio_info].den); //av_log(NULL, AV_LOG_ERROR, "B %d/%d\n",s->avctx->sample_aspect_ratio.num, s->avctx->sample_aspect_ratio.den); } @@ -1368,7 +1368,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx, if(s->pict_type == 0 || s->pict_type > 3) return -1; - vbv_delay= get_bits(&s->gb, 16); + vbv_delay = get_bits(&s->gb, 16); if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type == AV_PICTURE_TYPE_B) { s->full_pel[0] = get_bits1(&s->gb); f_code = get_bits(&s->gb, 3); @@ -1403,8 +1403,8 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) int bit_rate_ext; skip_bits(&s->gb, 1); /* profile and level esc*/ - s->avctx->profile= get_bits(&s->gb, 3); - s->avctx->level= get_bits(&s->gb, 4); + s->avctx->profile = get_bits(&s->gb, 3); + s->avctx->level = get_bits(&s->gb, 4); s->progressive_sequence = get_bits1(&s->gb); /* progressive_sequence */ s->chroma_format = get_bits(&s->gb, 2); /* chroma_format 1=420, 2=422, 3=444 */ horiz_size_ext = get_bits(&s->gb, 2); @@ -1423,7 +1423,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) s1->frame_rate_ext.den = get_bits(&s->gb, 5)+1; av_dlog(s->avctx, "sequence extension\n"); - s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG2VIDEO; + s->codec_id = s->avctx->codec_id = CODEC_ID_MPEG2VIDEO; s->avctx->sub_id = 2; /* indicates MPEG-2 found */ if(s->avctx->debug & FF_DEBUG_PICT_INFO) @@ -1438,18 +1438,18 @@ static void mpeg_decode_sequence_display_extension(Mpeg1Context *s1) int color_description, w, h; skip_bits(&s->gb, 3); /* video format */ - color_description= get_bits1(&s->gb); + color_description = get_bits1(&s->gb); if(color_description){ - s->avctx->color_primaries= get_bits(&s->gb, 8); + s->avctx->color_primaries = get_bits(&s->gb, 8); s->avctx->color_trc = get_bits(&s->gb, 8); s->avctx->colorspace = get_bits(&s->gb, 8); } - w= get_bits(&s->gb, 14); + w = get_bits(&s->gb, 14); skip_bits(&s->gb, 1); //marker - h= get_bits(&s->gb, 14); + h = get_bits(&s->gb, 14); // remaining 3 bits are zero padding - s1->pan_scan.width= 16*w; + s1->pan_scan.width = 16*w; s1->pan_scan.height=16*h; if(s->avctx->debug & FF_DEBUG_PICT_INFO) @@ -1502,7 +1502,7 @@ static int load_matrix(MpegEncContext *s, uint16_t matrix0[64], uint16_t matrix1 } if(intra && i==0 && v!=8){ av_log(s->avctx, AV_LOG_ERROR, "intra matrix invalid, ignoring\n"); - v= 8; // needed by pink.mpg / issue1046 + v = 8; // needed by pink.mpg / issue1046 } matrix0[j] = v; if(matrix1) @@ -1534,11 +1534,11 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1) av_log(s->avctx, AV_LOG_ERROR, "Missing picture start code, guessing missing values\n"); if(s->mpeg_f_code[1][0] == 15 && s->mpeg_f_code[1][1]==15){ if(s->mpeg_f_code[0][0] == 15 && s->mpeg_f_code[0][1] == 15) - s->pict_type= AV_PICTURE_TYPE_I; + s->pict_type = AV_PICTURE_TYPE_I; else - s->pict_type= AV_PICTURE_TYPE_P; + s->pict_type = AV_PICTURE_TYPE_P; }else - s->pict_type= AV_PICTURE_TYPE_B; + s->pict_type = AV_PICTURE_TYPE_B; s->current_picture.f.pict_type = s->pict_type; s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I; } @@ -1555,23 +1555,23 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1) s->progressive_frame = get_bits1(&s->gb); if(s->progressive_sequence && !s->progressive_frame){ - s->progressive_frame= 1; + s->progressive_frame = 1; av_log(s->avctx, AV_LOG_ERROR, "interlaced frame in progressive sequence, ignoring\n"); } if(s->picture_structure==0 || (s->progressive_frame && s->picture_structure!=PICT_FRAME)){ av_log(s->avctx, AV_LOG_ERROR, "picture_structure %d invalid, ignoring\n", s->picture_structure); - s->picture_structure= PICT_FRAME; + s->picture_structure = PICT_FRAME; } if(s->progressive_sequence && !s->frame_pred_frame_dct){ av_log(s->avctx, AV_LOG_ERROR, "invalid frame_pred_frame_dct\n"); - s->frame_pred_frame_dct= 1; + s->frame_pred_frame_dct = 1; } if(s->picture_structure == PICT_FRAME){ s->first_field=0; - s->v_edge_pos= 16*s->mb_height; + s->v_edge_pos = 16*s->mb_height; }else{ s->first_field ^= 1; s->v_edge_pos= 8*s->mb_height; @@ -1607,7 +1607,7 @@ static void exchange_uv(MpegEncContext *s){ } static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size){ - AVCodecContext *avctx= s->avctx; + AVCodecContext *avctx = s->avctx; Mpeg1Context *s1 = (Mpeg1Context*)s; /* start frame decoding */ @@ -1676,9 +1676,9 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, const uint8_t **buf, int buf_size) { MpegEncContext *s = &s1->mpeg_enc_ctx; - AVCodecContext *avctx= s->avctx; - const int field_pic= s->picture_structure != PICT_FRAME; - const int lowres= s->avctx->lowres; + AVCodecContext *avctx = s->avctx; + const int field_pic = s->picture_structure != PICT_FRAME; + const int lowres = s->avctx->lowres; s->resync_mb_x= s->resync_mb_y= -1; @@ -1743,9 +1743,9 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, return DECODE_SLICE_OK; } - s->resync_mb_x= s->mb_x; - s->resync_mb_y= s->mb_y= mb_y; - s->mb_skip_run= 0; + s->resync_mb_x = s->mb_x; + s->resync_mb_y = s->mb_y = mb_y; + s->mb_skip_run = 0; ff_init_block_index(s); if (s->mb_y==0 && s->mb_x==0 && (s->first_field || s->picture_structure==PICT_FRAME)) { @@ -1770,7 +1770,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, if (s->current_picture.f.motion_val[0] && !s->encoding) { //note motion_val is normally NULL unless we want to extract the MVs const int wrap = s->b8_stride; int xy = s->mb_x*2 + s->mb_y*2*wrap; - int b8_xy= 4*(s->mb_x + s->mb_y*s->mb_stride); + int b8_xy = 4*(s->mb_x + s->mb_y*s->mb_stride); int motion_x, motion_y, dir, i; for(i=0; i<2; i++){ @@ -1805,7 +1805,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, MPV_decode_mb(s, s->block); if (++s->mb_x >= s->mb_width) { - const int mb_size= 16>>s->avctx->lowres; + const int mb_size = 16>>s->avctx->lowres; ff_draw_horiz_band(s, mb_size*(s->mb_y>>field_pic), mb_size); MPV_report_decode_progress(s); @@ -1814,8 +1814,8 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, s->mb_y += 1<<field_pic; if(s->mb_y >= s->mb_height){ - int left= get_bits_left(&s->gb); - int is_d10= s->chroma_format==2 && s->pict_type==AV_PICTURE_TYPE_I && avctx->profile==0 && avctx->level==5 + int left = get_bits_left(&s->gb); + int is_d10 = s->chroma_format==2 && s->pict_type==AV_PICTURE_TYPE_I && avctx->profile==0 && avctx->level==5 && s->intra_dc_precision == 2 && s->q_scale_type == 1 && s->alternate_scan == 0 && s->progressive_frame == 0 /* vbv_delay == 0xBBB || 0xE10*/; @@ -1896,9 +1896,9 @@ eos: // end of slice static int slice_decode_thread(AVCodecContext *c, void *arg){ MpegEncContext *s= *(void**)arg; - const uint8_t *buf= s->gb.buffer; - int mb_y= s->start_mb_y; - const int field_pic= s->picture_structure != PICT_FRAME; + const uint8_t *buf = s->gb.buffer; + int mb_y = s->start_mb_y; + const int field_pic = s->picture_structure != PICT_FRAME; s->error_count= (3*(s->end_mb_y - s->start_mb_y)*s->mb_width) >> field_pic; @@ -1906,7 +1906,7 @@ static int slice_decode_thread(AVCodecContext *c, void *arg){ uint32_t start_code; int ret; - ret= mpeg_decode_slice((Mpeg1Context*)s, mb_y, &buf, s->gb.buffer_end - buf); + ret = mpeg_decode_slice((Mpeg1Context*)s, mb_y, &buf, s->gb.buffer_end - buf); emms_c(); //av_log(c, AV_LOG_DEBUG, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n", //ret, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, s->start_mb_y, s->end_mb_y, s->error_count); @@ -1996,7 +1996,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, height = get_bits(&s->gb, 12); if (width <= 0 || height <= 0) return -1; - s->aspect_ratio_info= get_bits(&s->gb, 4); + s->aspect_ratio_info = get_bits(&s->gb, 4); if (s->aspect_ratio_info == 0) { av_log(avctx, AV_LOG_ERROR, "aspect ratio has forbidden 0 value\n"); if (avctx->error_recognition >= FF_ER_COMPLIANT) @@ -2011,7 +2011,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, s->width = width; s->height = height; - s->avctx->rc_buffer_size= get_bits(&s->gb, 10) * 1024*16; + s->avctx->rc_buffer_size = get_bits(&s->gb, 10) * 1024*16; skip_bits(&s->gb, 1); /* get matrix */ @@ -2029,7 +2029,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, load_matrix(s, s->chroma_inter_matrix, s->inter_matrix, 0); } else { for(i=0;i<64;i++) { - int j= s->dsp.idct_permutation[i]; + int j = s->dsp.idct_permutation[i]; v = ff_mpeg1_default_non_intra_matrix[i]; s->inter_matrix[j] = v; s->chroma_inter_matrix[j] = v; @@ -2047,7 +2047,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, s->picture_structure = PICT_FRAME; s->frame_pred_frame_dct = 1; s->chroma_format = 1; - s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG1VIDEO; + s->codec_id = s->avctx->codec_id = CODEC_ID_MPEG1VIDEO; avctx->sub_id = 1; /* indicates MPEG-1 */ s->out_format = FMT_MPEG1; s->swap_uv = 0;//AFAIK VCR2 does not have SEQ_HEADER @@ -2073,8 +2073,8 @@ static int vcr2_init_sequence(AVCodecContext *avctx) } s->width = avctx->coded_width; s->height = avctx->coded_height; - avctx->has_b_frames= 0; //true? - s->low_delay= 1; + avctx->has_b_frames = 0; //true? + s->low_delay = 1; avctx->pix_fmt = mpeg_get_pixelformat(avctx); avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt); @@ -2091,7 +2091,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx) s1->mpeg_enc_ctx_allocated = 1; for(i=0;i<64;i++) { - int j= s->dsp.idct_permutation[i]; + int j = s->dsp.idct_permutation[i]; v = ff_mpeg1_default_intra_matrix[i]; s->intra_matrix[j] = v; s->chroma_intra_matrix[j] = v; @@ -2106,7 +2106,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx) s->picture_structure = PICT_FRAME; s->frame_pred_frame_dct = 1; s->chroma_format = 1; - s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG2VIDEO; + s->codec_id = s->avctx->codec_id = CODEC_ID_MPEG2VIDEO; avctx->sub_id = 2; /* indicates MPEG-2 */ s1->save_width = s->width; s1->save_height = s->height; @@ -2174,7 +2174,7 @@ static void mpeg_decode_gop(AVCodecContext *avctx, int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s) { int i; - uint32_t state= pc->state; + uint32_t state = pc->state; /* EOF considered as end of frame */ if (buf_size == 0) @@ -2194,12 +2194,12 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, if(state == EXT_START_CODE && (buf[i]&0xF0) != 0x80) pc->frame_start_found--; else if(state == EXT_START_CODE+2){ - if((buf[i]&3) == 3) pc->frame_start_found= 0; + if((buf[i]&3) == 3) pc->frame_start_found = 0; else pc->frame_start_found= (pc->frame_start_found+1)&3; } state++; }else{ - i= ff_find_start_code(buf+i, buf+buf_size, &state) - buf - 1; + i = ff_find_start_code(buf+i, buf+buf_size, &state) - buf - 1; if(pc->frame_start_found==0 && state >= SLICE_MIN_START_CODE && state <= SLICE_MAX_START_CODE){ i++; pc->frame_start_found=4; @@ -2209,7 +2209,7 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, return i+1; } if(pc->frame_start_found==2 && state == SEQ_START_CODE) - pc->frame_start_found= 0; + pc->frame_start_found = 0; if(pc->frame_start_found<4 && state == EXT_START_CODE) pc->frame_start_found++; if(pc->frame_start_found == 4 && (state&0xFFFFFF00) == 0x100){ @@ -2224,7 +2224,7 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, } } } - pc->state= state; + pc->state = state; return END_NOT_FOUND; } @@ -2248,7 +2248,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx, /* special case for last picture */ if (s2->low_delay==0 && s2->next_picture_ptr) { *picture= *(AVFrame*)s2->next_picture_ptr; - s2->next_picture_ptr= NULL; + s2->next_picture_ptr = NULL; *data_size = sizeof(AVFrame); } @@ -2256,7 +2256,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx, } if(s2->flags&CODEC_FLAG_TRUNCATED){ - int next= ff_mpeg1_find_frame_end(&s2->parse_context, buf, buf_size, NULL); + int next = ff_mpeg1_find_frame_end(&s2->parse_context, buf, buf_size, NULL); if( ff_combine_frame(&s2->parse_context, next, (const uint8_t **)&buf, &buf_size) < 0 ) return buf_size; @@ -2265,7 +2265,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx, if(s->mpeg_enc_ctx_allocated==0 && avctx->codec_tag == AV_RL32("VCR2")) vcr2_init_sequence(avctx); - s->slice_count= 0; + s->slice_count = 0; if(avctx->extradata && !avctx->frame_number) { int ret = decode_chunks(avctx, picture, data_size, avctx->extradata, avctx->extradata_size); @@ -2285,7 +2285,7 @@ static int decode_chunks(AVCodecContext *avctx, const uint8_t *buf_ptr = buf; const uint8_t *buf_end = buf + buf_size; int ret, input_size; - int last_code= 0; + int last_code = 0; for(;;) { /* find next start code */ @@ -2309,7 +2309,7 @@ static int decode_chunks(AVCodecContext *avctx, *data_size = sizeof(AVPicture); } } - s2->pict_type= 0; + s2->pict_type = 0; return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index); } @@ -2355,7 +2355,7 @@ static int decode_chunks(AVCodecContext *avctx, if (mpeg1_decode_picture(avctx, buf_ptr, input_size) < 0) s2->pict_type=0; s2->first_slice = 1; - last_code= PICTURE_START_CODE; + last_code = PICTURE_START_CODE; }else{ av_log(avctx, AV_LOG_ERROR, "ignoring pic after %X\n", last_code); if (avctx->error_recognition >= FF_ER_EXPLODE) @@ -2413,9 +2413,9 @@ static int decode_chunks(AVCodecContext *avctx, default: if (start_code >= SLICE_MIN_START_CODE && start_code <= SLICE_MAX_START_CODE && last_code!=0) { - const int field_pic= s2->picture_structure != PICT_FRAME; + const int field_pic = s2->picture_structure != PICT_FRAME; int mb_y= (start_code - SLICE_MIN_START_CODE) << field_pic; - last_code= SLICE_MIN_START_CODE; + last_code = SLICE_MIN_START_CODE; if(s2->picture_structure == PICT_BOTTOM_FIELD) mb_y++; @@ -2475,12 +2475,12 @@ static int decode_chunks(AVCodecContext *avctx, if(HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)){ int threshold= (s2->mb_height*s->slice_count + avctx->thread_count/2) / avctx->thread_count; if(threshold <= mb_y){ - MpegEncContext *thread_context= s2->thread_context[s->slice_count]; + MpegEncContext *thread_context = s2->thread_context[s->slice_count]; - thread_context->start_mb_y= mb_y; + thread_context->start_mb_y = mb_y; thread_context->end_mb_y = s2->mb_height; if(s->slice_count){ - s2->thread_context[s->slice_count-1]->end_mb_y= mb_y; + s2->thread_context[s->slice_count-1]->end_mb_y = mb_y; ff_update_duplicate_context(thread_context, s2); } init_get_bits(&thread_context->gb, buf_ptr, input_size*8); @@ -2545,10 +2545,10 @@ AVCodec ff_mpeg1video_decoder = { .close = mpeg_decode_end, .decode = mpeg_decode_frame, .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, - .flush= flush, - .max_lowres= 3, - .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"), - .update_thread_context= ONLY_IF_THREADS_ENABLED(mpeg_decode_update_thread_context) + .flush = flush, + .max_lowres = 3, + .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), + .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg_decode_update_thread_context) }; AVCodec ff_mpeg2video_decoder = { @@ -2560,9 +2560,9 @@ AVCodec ff_mpeg2video_decoder = { .close = mpeg_decode_end, .decode = mpeg_decode_frame, .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, - .flush= flush, - .max_lowres= 3, - .long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"), + .flush = flush, + .max_lowres = 3, + .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"), .profiles = NULL_IF_CONFIG_SMALL(mpeg2_video_profiles), }; @@ -2576,9 +2576,9 @@ AVCodec ff_mpegvideo_decoder = { .close = mpeg_decode_end, .decode = mpeg_decode_frame, .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, - .flush= flush, - .max_lowres= 3, - .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"), + .flush = flush, + .max_lowres = 3, + .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), }; #if CONFIG_MPEG_XVMC_DECODER @@ -2607,7 +2607,7 @@ AVCodec ff_mpeg_xvmc_decoder = { .close = mpeg_decode_end, .decode = mpeg_decode_frame, .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED| CODEC_CAP_HWACCEL | CODEC_CAP_DELAY, - .flush= flush, + .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MPEG-1/2 video XvMC (X-Video Motion Compensation)"), }; @@ -2623,7 +2623,7 @@ AVCodec ff_mpeg_vdpau_decoder = { .close = mpeg_decode_end, .decode = mpeg_decode_frame, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_HWACCEL_VDPAU | CODEC_CAP_DELAY, - .flush= flush, + .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MPEG-1/2 video (VDPAU acceleration)"), }; #endif @@ -2638,7 +2638,7 @@ AVCodec ff_mpeg1_vdpau_decoder = { .close = mpeg_decode_end, .decode = mpeg_decode_frame, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_HWACCEL_VDPAU | CODEC_CAP_DELAY, - .flush= flush, + .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video (VDPAU acceleration)"), }; #endif -- 1.7.2.5 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel