diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-06-29 21:59:37 +0200 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-07-27 15:24:58 +0100 |
commit | 7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615 (patch) | |
tree | 4613835d2ddad31bb5603827f28d8a4a6e4d9e21 /libavcodec/mpegvideo_enc.c | |
parent | 4b6b1082a73907c7c3de2646c6398bc61320f2c6 (diff) | |
download | ffmpeg-7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615.tar.gz |
lavc: AV-prefix all codec flags
Convert doxygen to multiline and express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index b348e984a1..b25ce47332 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -311,7 +311,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) s->max_b_frames = avctx->max_b_frames; s->codec_id = avctx->codec->id; s->strict_std_compliance = avctx->strict_std_compliance; - s->quarter_sample = (avctx->flags & CODEC_FLAG_QPEL) != 0; + s->quarter_sample = (avctx->flags & AV_CODEC_FLAG_QPEL) != 0; s->mpeg_quant = avctx->mpeg_quant; s->rtp_mode = !!avctx->rtp_payload_size; s->intra_dc_precision = avctx->intra_dc_precision; @@ -331,7 +331,7 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif /* Fixed QSCALE */ - s->fixed_qscale = !!(avctx->flags & CODEC_FLAG_QSCALE); + s->fixed_qscale = !!(avctx->flags & AV_CODEC_FLAG_QSCALE); #if FF_API_MPV_OPT FF_DISABLE_DEPRECATION_WARNINGS @@ -349,7 +349,7 @@ FF_ENABLE_DEPRECATION_WARNINGS (s->mpv_flags & FF_MPV_FLAG_QP_RD)) && !s->fixed_qscale; - s->loop_filter = !!(s->avctx->flags & CODEC_FLAG_LOOP_FILTER); + s->loop_filter = !!(s->avctx->flags & AV_CODEC_FLAG_LOOP_FILTER); if (avctx->rc_max_rate && !avctx->rc_buffer_size) { av_log(avctx, AV_LOG_ERROR, @@ -406,7 +406,7 @@ FF_ENABLE_DEPRECATION_WARNINGS "specified vbv buffer is too large for the given bitrate!\n"); } - if ((s->avctx->flags & CODEC_FLAG_4MV) && s->codec_id != AV_CODEC_ID_MPEG4 && + if ((s->avctx->flags & AV_CODEC_FLAG_4MV) && s->codec_id != AV_CODEC_ID_MPEG4 && s->codec_id != AV_CODEC_ID_H263 && s->codec_id != AV_CODEC_ID_H263P && s->codec_id != AV_CODEC_ID_FLV1) { av_log(avctx, AV_LOG_ERROR, "4MV not supported by codec\n"); @@ -443,7 +443,7 @@ FF_ENABLE_DEPRECATION_WARNINGS return -1; } - if ((s->avctx->flags & (CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME)) && + if ((s->avctx->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME)) && s->codec_id != AV_CODEC_ID_MPEG4 && s->codec_id != AV_CODEC_ID_MPEG2VIDEO) { av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n"); return -1; @@ -468,14 +468,14 @@ FF_ENABLE_DEPRECATION_WARNINGS } if (s->avctx->scenechange_threshold < 1000000000 && - (s->avctx->flags & CODEC_FLAG_CLOSED_GOP)) { + (s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP)) { av_log(avctx, AV_LOG_ERROR, "closed gop with scene change detection are not supported yet, " "set threshold to 1000000000\n"); return -1; } - if (s->avctx->flags & CODEC_FLAG_LOW_DELAY) { + if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) { if (s->codec_id != AV_CODEC_ID_MPEG2VIDEO) { av_log(avctx, AV_LOG_ERROR, "low delay forcing is only available for mpeg2\n"); @@ -521,7 +521,7 @@ FF_ENABLE_DEPRECATION_WARNINGS return -1; } - if (avctx->b_frame_strategy && (avctx->flags & CODEC_FLAG_PASS2)) { + if (avctx->b_frame_strategy && (avctx->flags & AV_CODEC_FLAG_PASS2)) { av_log(avctx, AV_LOG_INFO, "notice: b_frame_strategy only affects the first pass\n"); avctx->b_frame_strategy = 0; @@ -571,12 +571,12 @@ FF_ENABLE_DEPRECATION_WARNINGS switch (avctx->codec->id) { case AV_CODEC_ID_MPEG1VIDEO: s->out_format = FMT_MPEG1; - s->low_delay = !!(s->avctx->flags & CODEC_FLAG_LOW_DELAY); + s->low_delay = !!(s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY); avctx->delay = s->low_delay ? 0 : (s->max_b_frames + 1); break; case AV_CODEC_ID_MPEG2VIDEO: s->out_format = FMT_MPEG1; - s->low_delay = !!(s->avctx->flags & CODEC_FLAG_LOW_DELAY); + s->low_delay = !!(s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY); avctx->delay = s->low_delay ? 0 : (s->max_b_frames + 1); s->rtp_mode = 1; break; @@ -624,9 +624,9 @@ FF_ENABLE_DEPRECATION_WARNINGS s->out_format = FMT_H263; s->h263_plus = 1; /* Fx */ - s->h263_aic = (avctx->flags & CODEC_FLAG_AC_PRED) ? 1 : 0; + s->h263_aic = (avctx->flags & AV_CODEC_FLAG_AC_PRED) ? 1 : 0; s->modified_quant = s->h263_aic; - s->loop_filter = (avctx->flags & CODEC_FLAG_LOOP_FILTER) ? 1 : 0; + s->loop_filter = (avctx->flags & AV_CODEC_FLAG_LOOP_FILTER) ? 1 : 0; s->unrestricted_mv = s->obmc || s->loop_filter || s->umvplus; /* /Fx */ @@ -708,8 +708,8 @@ FF_ENABLE_DEPRECATION_WARNINGS s->encoding = 1; s->progressive_frame = - s->progressive_sequence = !(avctx->flags & (CODEC_FLAG_INTERLACED_DCT | - CODEC_FLAG_INTERLACED_ME) || + s->progressive_sequence = !(avctx->flags & (AV_CODEC_FLAG_INTERLACED_DCT | + AV_CODEC_FLAG_INTERLACED_ME) || s->alternate_scan); /* init */ @@ -1167,8 +1167,8 @@ static int estimate_best_b_count(MpegEncContext *s) c->width = s->width >> scale; c->height = s->height >> scale; - c->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR; - c->flags |= s->avctx->flags & CODEC_FLAG_QPEL; + c->flags = AV_CODEC_FLAG_QSCALE | AV_CODEC_FLAG_PSNR; + c->flags |= s->avctx->flags & AV_CODEC_FLAG_QPEL; c->mb_decision = s->avctx->mb_decision; c->me_cmp = s->avctx->me_cmp; c->mb_cmp = s->avctx->mb_cmp; @@ -1290,7 +1290,7 @@ static int select_input_picture(MpegEncContext *s) } } - if (s->avctx->flags & CODEC_FLAG_PASS2) { + if (s->avctx->flags & AV_CODEC_FLAG_PASS2) { for (i = 0; i < s->max_b_frames + 1; i++) { int pict_num = s->input_picture[0]->f->display_picture_number + i; @@ -1359,13 +1359,13 @@ static int select_input_picture(MpegEncContext *s) s->gop_size > s->picture_in_gop_number) { b_frames = s->gop_size - s->picture_in_gop_number - 1; } else { - if (s->avctx->flags & CODEC_FLAG_CLOSED_GOP) + if (s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP) b_frames = 0; s->input_picture[b_frames]->f->pict_type = AV_PICTURE_TYPE_I; } } - if ((s->avctx->flags & CODEC_FLAG_CLOSED_GOP) && b_frames && + if ((s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP) && b_frames && s->input_picture[b_frames]->f->pict_type == AV_PICTURE_TYPE_I) b_frames--; @@ -1686,7 +1686,7 @@ vbv_retry: assert(s->avctx->rc_max_rate); } - if (s->avctx->flags & CODEC_FLAG_PASS1) + if (s->avctx->flags & AV_CODEC_FLAG_PASS1) ff_write_pass1_stats(s); for (i = 0; i < 4; i++) { @@ -1694,7 +1694,7 @@ vbv_retry: avctx->error[i] += s->current_picture_ptr->f->error[i]; } - if (s->avctx->flags & CODEC_FLAG_PASS1) + if (s->avctx->flags & AV_CODEC_FLAG_PASS1) assert(avctx->header_bits + avctx->mv_bits + avctx->misc_bits + avctx->i_tex_bits + avctx->p_tex_bits == put_bits_count(&s->pb)); @@ -1982,7 +1982,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, } if (s->mb_intra) { - if (s->avctx->flags & CODEC_FLAG_INTERLACED_DCT) { + if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) { int progressive_score, interlaced_score; s->interlaced_dct = 0; @@ -2011,7 +2011,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, s->pdsp.get_pixels(s->block[2], ptr_y + dct_offset, wrap_y); s->pdsp.get_pixels(s->block[3], ptr_y + dct_offset + 8, wrap_y); - if (s->avctx->flags & CODEC_FLAG_GRAY) { + if (s->avctx->flags & AV_CODEC_FLAG_GRAY) { skip_dct[4] = 1; skip_dct[5] = 1; } else { @@ -2054,7 +2054,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, op_pix, op_qpix); } - if (s->avctx->flags & CODEC_FLAG_INTERLACED_DCT) { + if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) { int progressive_score, interlaced_score; s->interlaced_dct = 0; @@ -2091,7 +2091,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, s->pdsp.diff_pixels(s->block[3], ptr_y + dct_offset + 8, dest_y + dct_offset + 8, wrap_y); - if (s->avctx->flags & CODEC_FLAG_GRAY) { + if (s->avctx->flags & AV_CODEC_FLAG_GRAY) { skip_dct[4] = 1; skip_dct[5] = 1; } else { @@ -2201,7 +2201,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, } } - if ((s->avctx->flags & CODEC_FLAG_GRAY) && s->mb_intra) { + if ((s->avctx->flags & AV_CODEC_FLAG_GRAY) && s->mb_intra) { s->block_last_index[4] = s->block_last_index[5] = 0; s->block[4][0] = @@ -2513,7 +2513,7 @@ static void write_slice_end(MpegEncContext *s){ avpriv_align_put_bits(&s->pb); flush_put_bits(&s->pb); - if ((s->avctx->flags & CODEC_FLAG_PASS1) && !s->partitioned_frame) + if ((s->avctx->flags & AV_CODEC_FLAG_PASS1) && !s->partitioned_frame) s->misc_bits+= get_bits_diff(s); } @@ -2724,7 +2724,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ break; } - if (s->avctx->flags & CODEC_FLAG_PASS1) { + if (s->avctx->flags & AV_CODEC_FLAG_PASS1) { int bits= put_bits_count(&s->pb); s->misc_bits+= bits - s->last_bits; s->last_bits= bits; @@ -3143,7 +3143,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ s->p_mv_table[xy][1]=0; } - if (s->avctx->flags & CODEC_FLAG_PSNR) { + if (s->avctx->flags & AV_CODEC_FLAG_PSNR) { int w= 16; int h= 16; @@ -3308,11 +3308,11 @@ static int encode_picture(MpegEncContext *s, int picture_number) s->no_rounding ^= 1; } - if (s->avctx->flags & CODEC_FLAG_PASS2) { + if (s->avctx->flags & AV_CODEC_FLAG_PASS2) { if (estimate_qp(s,1) < 0) return -1; ff_get_2pass_fcode(s); - } else if (!(s->avctx->flags & CODEC_FLAG_QSCALE)) { + } else if (!(s->avctx->flags & AV_CODEC_FLAG_QSCALE)) { if(s->pict_type==AV_PICTURE_TYPE_B) s->lambda= s->last_lambda_for[s->pict_type]; else @@ -3370,7 +3370,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) if(s->pict_type==AV_PICTURE_TYPE_P || s->pict_type==AV_PICTURE_TYPE_S) { s->f_code= ff_get_best_fcode(s, s->p_mv_table, CANDIDATE_MB_TYPE_INTER); - if (s->avctx->flags & CODEC_FLAG_INTERLACED_ME) { + if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) { int a,b; a= ff_get_best_fcode(s, s->p_field_mv_table[0][0], CANDIDATE_MB_TYPE_INTER_I); //FIXME field_select b= ff_get_best_fcode(s, s->p_field_mv_table[1][1], CANDIDATE_MB_TYPE_INTER_I); @@ -3379,7 +3379,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) ff_fix_long_p_mvs(s); ff_fix_long_mvs(s, NULL, 0, s->p_mv_table, s->f_code, CANDIDATE_MB_TYPE_INTER, 0); - if (s->avctx->flags & CODEC_FLAG_INTERLACED_ME) { + if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) { int j; for(i=0; i<2; i++){ for(j=0; j<2; j++) @@ -3404,7 +3404,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) ff_fix_long_mvs(s, NULL, 0, s->b_back_mv_table, s->b_code, CANDIDATE_MB_TYPE_BACKWARD, 1); ff_fix_long_mvs(s, NULL, 0, s->b_bidir_forw_mv_table, s->f_code, CANDIDATE_MB_TYPE_BIDIR, 1); ff_fix_long_mvs(s, NULL, 0, s->b_bidir_back_mv_table, s->b_code, CANDIDATE_MB_TYPE_BIDIR, 1); - if (s->avctx->flags & CODEC_FLAG_INTERLACED_ME) { + if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) { int dir, j; for(dir=0; dir<2; dir++){ for(i=0; i<2; i++){ @@ -3425,7 +3425,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) if (s->qscale < 3 && s->max_qcoeff <= 128 && s->pict_type == AV_PICTURE_TYPE_I && - !(s->avctx->flags & CODEC_FLAG_QSCALE)) + !(s->avctx->flags & AV_CODEC_FLAG_QSCALE)) s->qscale= 3; //reduce clipping problems if (s->out_format == FMT_MJPEG) { |