@ -311,7 +311,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
s - > max_b_frames = avctx - > max_b_frames ;
s - > max_b_frames = avctx - > max_b_frames ;
s - > codec_id = avctx - > codec - > id ;
s - > codec_id = avctx - > codec - > id ;
s - > strict_std_compliance = avctx - > strict_std_compliance ;
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 - > mpeg_quant = avctx - > mpeg_quant ;
s - > rtp_mode = ! ! avctx - > rtp_payload_size ;
s - > rtp_mode = ! ! avctx - > rtp_payload_size ;
s - > intra_dc_precision = avctx - > intra_dc_precision ;
s - > intra_dc_precision = avctx - > intra_dc_precision ;
@ -331,7 +331,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
# endif
# endif
/* Fixed QSCALE */
/* Fixed QSCALE */
s - > fixed_qscale = ! ! ( avctx - > flags & CODEC_FLAG_QSCALE ) ;
s - > fixed_qscale = ! ! ( avctx - > flags & AV_ CODEC_FLAG_QSCALE) ;
# if FF_API_MPV_OPT
# if FF_API_MPV_OPT
FF_DISABLE_DEPRECATION_WARNINGS
FF_DISABLE_DEPRECATION_WARNINGS
@ -349,7 +349,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
( s - > mpv_flags & FF_MPV_FLAG_QP_RD ) ) & &
( s - > mpv_flags & FF_MPV_FLAG_QP_RD ) ) & &
! s - > fixed_qscale ;
! 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 ) {
if ( avctx - > rc_max_rate & & ! avctx - > rc_buffer_size ) {
av_log ( avctx , AV_LOG_ERROR ,
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 " ) ;
" 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_H263 & & s - > codec_id ! = AV_CODEC_ID_H263P & &
s - > codec_id ! = AV_CODEC_ID_FLV1 ) {
s - > codec_id ! = AV_CODEC_ID_FLV1 ) {
av_log ( avctx , AV_LOG_ERROR , " 4MV not supported by codec \n " ) ;
av_log ( avctx , AV_LOG_ERROR , " 4MV not supported by codec \n " ) ;
@ -443,7 +443,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
return - 1 ;
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 ) {
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 " ) ;
av_log ( avctx , AV_LOG_ERROR , " interlacing not supported by codec \n " ) ;
return - 1 ;
return - 1 ;
@ -468,14 +468,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
}
if ( s - > avctx - > scenechange_threshold < 1000000000 & &
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 ,
av_log ( avctx , AV_LOG_ERROR ,
" closed gop with scene change detection are not supported yet, "
" closed gop with scene change detection are not supported yet, "
" set threshold to 1000000000 \n " ) ;
" set threshold to 1000000000 \n " ) ;
return - 1 ;
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 ) {
if ( s - > codec_id ! = AV_CODEC_ID_MPEG2VIDEO ) {
av_log ( avctx , AV_LOG_ERROR ,
av_log ( avctx , AV_LOG_ERROR ,
" low delay forcing is only available for mpeg2 \n " ) ;
" low delay forcing is only available for mpeg2 \n " ) ;
@ -521,7 +521,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
return - 1 ;
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 ,
av_log ( avctx , AV_LOG_INFO ,
" notice: b_frame_strategy only affects the first pass \n " ) ;
" notice: b_frame_strategy only affects the first pass \n " ) ;
avctx - > b_frame_strategy = 0 ;
avctx - > b_frame_strategy = 0 ;
@ -571,12 +571,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
switch ( avctx - > codec - > id ) {
switch ( avctx - > codec - > id ) {
case AV_CODEC_ID_MPEG1VIDEO :
case AV_CODEC_ID_MPEG1VIDEO :
s - > out_format = FMT_MPEG1 ;
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 ) ;
avctx - > delay = s - > low_delay ? 0 : ( s - > max_b_frames + 1 ) ;
break ;
break ;
case AV_CODEC_ID_MPEG2VIDEO :
case AV_CODEC_ID_MPEG2VIDEO :
s - > out_format = FMT_MPEG1 ;
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 ) ;
avctx - > delay = s - > low_delay ? 0 : ( s - > max_b_frames + 1 ) ;
s - > rtp_mode = 1 ;
s - > rtp_mode = 1 ;
break ;
break ;
@ -624,9 +624,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
s - > out_format = FMT_H263 ;
s - > out_format = FMT_H263 ;
s - > h263_plus = 1 ;
s - > h263_plus = 1 ;
/* Fx */
/* 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 - > 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 ;
s - > unrestricted_mv = s - > obmc | | s - > loop_filter | | s - > umvplus ;
/* /Fx */
/* /Fx */
@ -708,8 +708,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
s - > encoding = 1 ;
s - > encoding = 1 ;
s - > progressive_frame =
s - > progressive_frame =
s - > progressive_sequence = ! ( avctx - > flags & ( CODEC_FLAG_INTERLACED_DCT |
s - > progressive_sequence = ! ( avctx - > flags & ( AV_ CODEC_FLAG_INTERLACED_DCT |
CODEC_FLAG_INTERLACED_ME ) | |
AV_ CODEC_FLAG_INTERLACED_ME) | |
s - > alternate_scan ) ;
s - > alternate_scan ) ;
/* init */
/* init */
@ -1167,8 +1167,8 @@ static int estimate_best_b_count(MpegEncContext *s)
c - > width = s - > width > > scale ;
c - > width = s - > width > > scale ;
c - > height = s - > height > > scale ;
c - > height = s - > height > > scale ;
c - > flags = CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR ;
c - > flags = AV_ CODEC_FLAG_QSCALE | AV_ CODEC_FLAG_PSNR;
c - > flags | = s - > avctx - > flags & CODEC_FLAG_QPEL ;
c - > flags | = s - > avctx - > flags & AV_ CODEC_FLAG_QPEL;
c - > mb_decision = s - > avctx - > mb_decision ;
c - > mb_decision = s - > avctx - > mb_decision ;
c - > me_cmp = s - > avctx - > me_cmp ;
c - > me_cmp = s - > avctx - > me_cmp ;
c - > mb_cmp = s - > avctx - > mb_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 + + ) {
for ( i = 0 ; i < s - > max_b_frames + 1 ; i + + ) {
int pict_num = s - > input_picture [ 0 ] - > f - > display_picture_number + 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 ) {
s - > gop_size > s - > picture_in_gop_number ) {
b_frames = s - > gop_size - s - > picture_in_gop_number - 1 ;
b_frames = s - > gop_size - s - > picture_in_gop_number - 1 ;
} else {
} else {
if ( s - > avctx - > flags & CODEC_FLAG_CLOSED_GOP )
if ( s - > avctx - > flags & AV_ CODEC_FLAG_CLOSED_GOP)
b_frames = 0 ;
b_frames = 0 ;
s - > input_picture [ b_frames ] - > f - > pict_type = AV_PICTURE_TYPE_I ;
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 )
s - > input_picture [ b_frames ] - > f - > pict_type = = AV_PICTURE_TYPE_I )
b_frames - - ;
b_frames - - ;
@ -1686,7 +1686,7 @@ vbv_retry:
assert ( s - > avctx - > rc_max_rate ) ;
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 ) ;
ff_write_pass1_stats ( s ) ;
for ( i = 0 ; i < 4 ; i + + ) {
for ( i = 0 ; i < 4 ; i + + ) {
@ -1694,7 +1694,7 @@ vbv_retry:
avctx - > error [ i ] + = s - > current_picture_ptr - > f - > error [ i ] ;
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 +
assert ( avctx - > header_bits + avctx - > mv_bits + avctx - > misc_bits +
avctx - > i_tex_bits + avctx - > p_tex_bits = =
avctx - > i_tex_bits + avctx - > p_tex_bits = =
put_bits_count ( & s - > pb ) ) ;
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 - > mb_intra ) {
if ( s - > avctx - > flags & CODEC_FLAG_INTERLACED_DCT ) {
if ( s - > avctx - > flags & AV_ CODEC_FLAG_INTERLACED_DCT) {
int progressive_score , interlaced_score ;
int progressive_score , interlaced_score ;
s - > interlaced_dct = 0 ;
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 [ 2 ] , ptr_y + dct_offset , wrap_y ) ;
s - > pdsp . get_pixels ( s - > block [ 3 ] , ptr_y + dct_offset + 8 , 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 [ 4 ] = 1 ;
skip_dct [ 5 ] = 1 ;
skip_dct [ 5 ] = 1 ;
} else {
} else {
@ -2054,7 +2054,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
op_pix , op_qpix ) ;
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 ;
int progressive_score , interlaced_score ;
s - > interlaced_dct = 0 ;
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 ,
s - > pdsp . diff_pixels ( s - > block [ 3 ] , ptr_y + dct_offset + 8 ,
dest_y + dct_offset + 8 , wrap_y ) ;
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 [ 4 ] = 1 ;
skip_dct [ 5 ] = 1 ;
skip_dct [ 5 ] = 1 ;
} else {
} 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 [ 4 ] =
s - > block_last_index [ 5 ] = 0 ;
s - > block_last_index [ 5 ] = 0 ;
s - > block [ 4 ] [ 0 ] =
s - > block [ 4 ] [ 0 ] =
@ -2513,7 +2513,7 @@ static void write_slice_end(MpegEncContext *s){
avpriv_align_put_bits ( & s - > pb ) ;
avpriv_align_put_bits ( & s - > pb ) ;
flush_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 ) ;
s - > misc_bits + = get_bits_diff ( s ) ;
}
}
@ -2724,7 +2724,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
break ;
break ;
}
}
if ( s - > avctx - > flags & CODEC_FLAG_PASS1 ) {
if ( s - > avctx - > flags & AV_ CODEC_FLAG_PASS1) {
int bits = put_bits_count ( & s - > pb ) ;
int bits = put_bits_count ( & s - > pb ) ;
s - > misc_bits + = bits - s - > last_bits ;
s - > misc_bits + = bits - s - > last_bits ;
s - > last_bits = bits ;
s - > last_bits = bits ;
@ -3143,7 +3143,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
s - > p_mv_table [ xy ] [ 1 ] = 0 ;
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 w = 16 ;
int h = 16 ;
int h = 16 ;
@ -3308,11 +3308,11 @@ static int encode_picture(MpegEncContext *s, int picture_number)
s - > no_rounding ^ = 1 ;
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 )
if ( estimate_qp ( s , 1 ) < 0 )
return - 1 ;
return - 1 ;
ff_get_2pass_fcode ( s ) ;
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 )
if ( s - > pict_type = = AV_PICTURE_TYPE_B )
s - > lambda = s - > last_lambda_for [ s - > pict_type ] ;
s - > lambda = s - > last_lambda_for [ s - > pict_type ] ;
else
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 ) {
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 ) ;
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 ;
int a , b ;
a = ff_get_best_fcode ( s , s - > p_field_mv_table [ 0 ] [ 0 ] , CANDIDATE_MB_TYPE_INTER_I ) ; //FIXME field_select
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 ) ;
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_p_mvs ( s ) ;
ff_fix_long_mvs ( s , NULL , 0 , s - > p_mv_table , s - > f_code , CANDIDATE_MB_TYPE_INTER , 0 ) ;
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 ;
int j ;
for ( i = 0 ; i < 2 ; i + + ) {
for ( i = 0 ; i < 2 ; i + + ) {
for ( j = 0 ; j < 2 ; j + + )
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_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_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 ) ;
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 ;
int dir , j ;
for ( dir = 0 ; dir < 2 ; dir + + ) {
for ( dir = 0 ; dir < 2 ; dir + + ) {
for ( i = 0 ; i < 2 ; i + + ) {
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 & &
if ( s - > qscale < 3 & & s - > max_qcoeff < = 128 & &
s - > pict_type = = AV_PICTURE_TYPE_I & &
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
s - > qscale = 3 ; //reduce clipping problems
if ( s - > out_format = = FMT_MJPEG ) {
if ( s - > out_format = = FMT_MJPEG ) {