Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-22 21:12:51 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-05-22 21:24:41 +0300
commitd9b264bc73723ce538d72f28a4a8fb4f85af7eca (patch)
tree7a2f93dbd9adf87534c29c932ed157941a2c4af6 /libavcodec/mpegvideo_enc.c
parent337aa17e61091500b95d6127c9ffd65d9086decb (diff)
parent848e86f74d3e6e87fa592ee8ba8c184cc5fd9a42 (diff)
Merge commit '848e86f74d3e6e87fa592ee8ba8c184cc5fd9a42'
* commit '848e86f74d3e6e87fa592ee8ba8c184cc5fd9a42': mpegvideo: Drop flags and flags2 Conflicts: libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/ratecontrol.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 5eb2d9a6ae..3a1b3d65ac 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -327,8 +327,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
}
s->gop_size = avctx->gop_size;
s->avctx = avctx;
- s->flags = avctx->flags;
- s->flags2 = avctx->flags2;
if (avctx->max_b_frames > MAX_B_FRAMES) {
av_log(avctx, AV_LOG_ERROR, "Too many B-frames requested, maximum "
"is %d.\n", MAX_B_FRAMES);
@@ -389,7 +387,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
(s->mpv_flags & FF_MPV_FLAG_QP_RD)) &&
!s->fixed_qscale;
- s->loop_filter = !!(s->flags & CODEC_FLAG_LOOP_FILTER);
+ s->loop_filter = !!(s->avctx->flags & CODEC_FLAG_LOOP_FILTER);
if (avctx->rc_max_rate && !avctx->rc_buffer_size) {
switch(avctx->codec_id) {
@@ -470,7 +468,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
"specified vbv buffer is too large for the given bitrate!\n");
}
- if ((s->flags & CODEC_FLAG_4MV) && s->codec_id != AV_CODEC_ID_MPEG4 &&
+ if ((s->avctx->flags & 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");
@@ -563,7 +561,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
return -1;
}
- if ((s->flags & (CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME)) &&
+ if ((s->avctx->flags & (CODEC_FLAG_INTERLACED_DCT | 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;
@@ -589,14 +587,14 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
}
if (s->avctx->scenechange_threshold < 1000000000 &&
- (s->flags & CODEC_FLAG_CLOSED_GOP)) {
+ (s->avctx->flags & 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->flags & CODEC_FLAG_LOW_DELAY) {
+ if (s->avctx->flags & 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");
@@ -696,12 +694,12 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
switch (avctx->codec->id) {
case AV_CODEC_ID_MPEG1VIDEO:
s->out_format = FMT_MPEG1;
- s->low_delay = !!(s->flags & CODEC_FLAG_LOW_DELAY);
+ s->low_delay = !!(s->avctx->flags & 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->flags & CODEC_FLAG_LOW_DELAY);
+ s->low_delay = !!(s->avctx->flags & CODEC_FLAG_LOW_DELAY);
avctx->delay = s->low_delay ? 0 : (s->max_b_frames + 1);
s->rtp_mode = 1;
break;
@@ -1422,7 +1420,7 @@ static int select_input_picture(MpegEncContext *s)
} else {
int b_frames;
- if (s->flags & CODEC_FLAG_PASS2) {
+ if (s->avctx->flags & 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;
@@ -1491,13 +1489,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->flags & CODEC_FLAG_CLOSED_GOP)
+ if (s->avctx->flags & CODEC_FLAG_CLOSED_GOP)
b_frames = 0;
s->input_picture[b_frames]->f->pict_type = AV_PICTURE_TYPE_I;
}
}
- if ((s->flags & CODEC_FLAG_CLOSED_GOP) && b_frames &&
+ if ((s->avctx->flags & CODEC_FLAG_CLOSED_GOP) && b_frames &&
s->input_picture[b_frames]->f->pict_type == AV_PICTURE_TYPE_I)
b_frames--;
@@ -1811,7 +1809,7 @@ vbv_retry:
av_assert0(s->avctx->rc_max_rate);
}
- if (s->flags & CODEC_FLAG_PASS1)
+ if (s->avctx->flags & CODEC_FLAG_PASS1)
ff_write_pass1_stats(s);
for (i = 0; i < 4; i++) {
@@ -1821,7 +1819,7 @@ vbv_retry:
avctx->error[i] += s->current_picture_ptr->f->error[i];
}
- if (s->flags & CODEC_FLAG_PASS1)
+ if (s->avctx->flags & 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));
@@ -2123,7 +2121,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
}
if (s->mb_intra) {
- if (s->flags & CODEC_FLAG_INTERLACED_DCT) {
+ if (s->avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
int progressive_score, interlaced_score;
s->interlaced_dct = 0;
@@ -2154,7 +2152,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->flags & CODEC_FLAG_GRAY) {
+ if (s->avctx->flags & CODEC_FLAG_GRAY) {
skip_dct[4] = 1;
skip_dct[5] = 1;
} else {
@@ -2202,7 +2200,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
op_pix, op_qpix);
}
- if (s->flags & CODEC_FLAG_INTERLACED_DCT) {
+ if (s->avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
int progressive_score, interlaced_score;
s->interlaced_dct = 0;
@@ -2240,7 +2238,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->flags & CODEC_FLAG_GRAY) {
+ if (s->avctx->flags & CODEC_FLAG_GRAY) {
skip_dct[4] = 1;
skip_dct[5] = 1;
} else {
@@ -2350,7 +2348,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
}
}
- if ((s->flags & CODEC_FLAG_GRAY) && s->mb_intra) {
+ if ((s->avctx->flags & CODEC_FLAG_GRAY) && s->mb_intra) {
s->block_last_index[4] =
s->block_last_index[5] = 0;
s->block[4][0] =
@@ -2674,7 +2672,7 @@ static void write_slice_end(MpegEncContext *s){
avpriv_align_put_bits(&s->pb);
flush_put_bits(&s->pb);
- if((s->flags&CODEC_FLAG_PASS1) && !s->partitioned_frame)
+ if ((s->avctx->flags & CODEC_FLAG_PASS1) && !s->partitioned_frame)
s->misc_bits+= get_bits_diff(s);
}
@@ -2918,7 +2916,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
break;
}
- if(s->flags&CODEC_FLAG_PASS1){
+ if (s->avctx->flags & CODEC_FLAG_PASS1) {
int bits= put_bits_count(&s->pb);
s->misc_bits+= bits - s->last_bits;
s->last_bits= bits;
@@ -3338,7 +3336,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
s->p_mv_table[xy][1]=0;
}
- if(s->flags&CODEC_FLAG_PSNR){
+ if (s->avctx->flags & CODEC_FLAG_PSNR) {
int w= 16;
int h= 16;
@@ -3503,11 +3501,11 @@ static int encode_picture(MpegEncContext *s, int picture_number)
s->no_rounding ^= 1;
}
- if(s->flags & CODEC_FLAG_PASS2){
+ if (s->avctx->flags & CODEC_FLAG_PASS2) {
if (estimate_qp(s,1) < 0)
return -1;
ff_get_2pass_fcode(s);
- }else if(!(s->flags & CODEC_FLAG_QSCALE)){
+ } else if (!(s->avctx->flags & CODEC_FLAG_QSCALE)) {
if(s->pict_type==AV_PICTURE_TYPE_B)
s->lambda= s->last_lambda_for[s->pict_type];
else
@@ -3574,7 +3572,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->flags & CODEC_FLAG_INTERLACED_ME){
+ if (s->avctx->flags & 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);
@@ -3583,7 +3581,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->flags & CODEC_FLAG_INTERLACED_ME){
+ if (s->avctx->flags & CODEC_FLAG_INTERLACED_ME) {
int j;
for(i=0; i<2; i++){
for(j=0; j<2; j++)
@@ -3608,7 +3606,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->flags & CODEC_FLAG_INTERLACED_ME){
+ if (s->avctx->flags & CODEC_FLAG_INTERLACED_ME) {
int dir, j;
for(dir=0; dir<2; dir++){
for(i=0; i<2; i++){
@@ -3627,7 +3625,9 @@ static int encode_picture(MpegEncContext *s, int picture_number)
if (estimate_qp(s, 0) < 0)
return -1;
- if(s->qscale < 3 && s->max_qcoeff<=128 && s->pict_type==AV_PICTURE_TYPE_I && !(s->flags & CODEC_FLAG_QSCALE))
+ if (s->qscale < 3 && s->max_qcoeff <= 128 &&
+ s->pict_type == AV_PICTURE_TYPE_I &&
+ !(s->avctx->flags & CODEC_FLAG_QSCALE))
s->qscale= 3; //reduce clipping problems
if (s->out_format == FMT_MJPEG) {