|
|
|
@ -361,7 +361,7 @@ static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type, |
|
|
|
|
|
|
|
|
|
if (ref) |
|
|
|
|
av_log(s->avctx, AV_LOG_DEBUG, "Interlaced error concealment is not fully implemented\n"); |
|
|
|
|
ff_MPV_decode_mb(s, s->block); |
|
|
|
|
ff_mpv_decode_mb(s, s->block); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void gray16(uint8_t *dst, const uint8_t *src, ptrdiff_t linesize, int h) |
|
|
|
@ -409,16 +409,16 @@ static av_cold int dct_init(MpegEncContext *s) |
|
|
|
|
s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c; |
|
|
|
|
|
|
|
|
|
if (HAVE_INTRINSICS_NEON) |
|
|
|
|
ff_MPV_common_init_neon(s); |
|
|
|
|
ff_mpv_common_init_neon(s); |
|
|
|
|
|
|
|
|
|
if (ARCH_ALPHA) |
|
|
|
|
ff_MPV_common_init_axp(s); |
|
|
|
|
ff_mpv_common_init_axp(s); |
|
|
|
|
if (ARCH_ARM) |
|
|
|
|
ff_MPV_common_init_arm(s); |
|
|
|
|
ff_mpv_common_init_arm(s); |
|
|
|
|
if (ARCH_PPC) |
|
|
|
|
ff_MPV_common_init_ppc(s); |
|
|
|
|
ff_mpv_common_init_ppc(s); |
|
|
|
|
if (ARCH_X86) |
|
|
|
|
ff_MPV_common_init_x86(s); |
|
|
|
|
ff_mpv_common_init_x86(s); |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
@ -865,7 +865,7 @@ static int init_duplicate_context(MpegEncContext *s) |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
fail: |
|
|
|
|
return -1; // free() through ff_MPV_common_end()
|
|
|
|
|
return -1; // free() through ff_mpv_common_end()
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void free_duplicate_context(MpegEncContext *s) |
|
|
|
@ -964,7 +964,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, |
|
|
|
|
// s->picture_range_start += MAX_PICTURE_COUNT;
|
|
|
|
|
// s->picture_range_end += MAX_PICTURE_COUNT;
|
|
|
|
|
ff_mpv_idct_init(s); |
|
|
|
|
if((ret = ff_MPV_common_init(s)) < 0){ |
|
|
|
|
if((ret = ff_mpv_common_init(s)) < 0){ |
|
|
|
|
memset(s, 0, sizeof(MpegEncContext)); |
|
|
|
|
s->avctx = dst; |
|
|
|
|
return ret; |
|
|
|
@ -976,7 +976,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, |
|
|
|
|
s->context_reinit = 0; |
|
|
|
|
s->height = s1->height; |
|
|
|
|
s->width = s1->width; |
|
|
|
|
if ((ret = ff_MPV_common_frame_size_change(s)) < 0) |
|
|
|
|
if ((ret = ff_mpv_common_frame_size_change(s)) < 0) |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1079,7 +1079,7 @@ do {\ |
|
|
|
|
* The changed fields will not depend upon the |
|
|
|
|
* prior state of the MpegEncContext. |
|
|
|
|
*/ |
|
|
|
|
void ff_MPV_common_defaults(MpegEncContext *s) |
|
|
|
|
void ff_mpv_common_defaults(MpegEncContext *s) |
|
|
|
|
{ |
|
|
|
|
s->y_dc_scale_table = |
|
|
|
|
s->c_dc_scale_table = ff_mpeg1_dc_scale_table; |
|
|
|
@ -1102,9 +1102,9 @@ void ff_MPV_common_defaults(MpegEncContext *s) |
|
|
|
|
* the changed fields will not depend upon |
|
|
|
|
* the prior state of the MpegEncContext. |
|
|
|
|
*/ |
|
|
|
|
void ff_MPV_decode_defaults(MpegEncContext *s) |
|
|
|
|
void ff_mpv_decode_defaults(MpegEncContext *s) |
|
|
|
|
{ |
|
|
|
|
ff_MPV_common_defaults(s); |
|
|
|
|
ff_mpv_common_defaults(s); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static int init_er(MpegEncContext *s) |
|
|
|
@ -1271,7 +1271,7 @@ fail: |
|
|
|
|
* init common structure for both encoder and decoder. |
|
|
|
|
* this assumes that some variables like width/height are already set |
|
|
|
|
*/ |
|
|
|
|
av_cold int ff_MPV_common_init(MpegEncContext *s) |
|
|
|
|
av_cold int ff_mpv_common_init(MpegEncContext *s) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
int nb_slices = (HAVE_THREADS && |
|
|
|
@ -1380,7 +1380,7 @@ av_cold int ff_MPV_common_init(MpegEncContext *s) |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
fail: |
|
|
|
|
ff_MPV_common_end(s); |
|
|
|
|
ff_mpv_common_end(s); |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1440,7 +1440,7 @@ static int free_context_frame(MpegEncContext *s) |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int ff_MPV_common_frame_size_change(MpegEncContext *s) |
|
|
|
|
int ff_mpv_common_frame_size_change(MpegEncContext *s) |
|
|
|
|
{ |
|
|
|
|
int i, err = 0; |
|
|
|
|
|
|
|
|
@ -1509,12 +1509,12 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s) |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
fail: |
|
|
|
|
ff_MPV_common_end(s); |
|
|
|
|
ff_mpv_common_end(s); |
|
|
|
|
return err; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* init common structure for both encoder and decoder */ |
|
|
|
|
void ff_MPV_common_end(MpegEncContext *s) |
|
|
|
|
void ff_mpv_common_end(MpegEncContext *s) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
@ -1745,7 +1745,7 @@ static void gray_frame(AVFrame *frame) |
|
|
|
|
* generic function called after decoding |
|
|
|
|
* the header and before a frame is decoded. |
|
|
|
|
*/ |
|
|
|
|
int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) |
|
|
|
|
int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) |
|
|
|
|
{ |
|
|
|
|
int i, ret; |
|
|
|
|
Picture *pic; |
|
|
|
@ -1975,7 +1975,7 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* called after a frame has been decoded. */ |
|
|
|
|
void ff_MPV_frame_end(MpegEncContext *s) |
|
|
|
|
void ff_mpv_frame_end(MpegEncContext *s) |
|
|
|
|
{ |
|
|
|
|
emms_c(); |
|
|
|
|
|
|
|
|
@ -2804,7 +2804,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s, |
|
|
|
|
/**
|
|
|
|
|
* find the lowest MB row referenced in the MVs |
|
|
|
|
*/ |
|
|
|
|
int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir) |
|
|
|
|
int ff_mpv_lowest_referenced_row(MpegEncContext *s, int dir) |
|
|
|
|
{ |
|
|
|
|
int my_max = INT_MIN, my_min = INT_MAX, qpel_shift = !s->quarter_sample; |
|
|
|
|
int my, off, i, mvs; |
|
|
|
@ -2910,7 +2910,7 @@ void ff_clean_intra_table_entries(MpegEncContext *s) |
|
|
|
|
s->interlaced_dct : true if interlaced dct used (mpeg2) |
|
|
|
|
*/ |
|
|
|
|
static av_always_inline |
|
|
|
|
void MPV_decode_mb_internal(MpegEncContext *s, int16_t block[12][64], |
|
|
|
|
void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64], |
|
|
|
|
int lowres_flag, int is_mpeg12) |
|
|
|
|
{ |
|
|
|
|
const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; |
|
|
|
@ -2999,12 +2999,12 @@ void MPV_decode_mb_internal(MpegEncContext *s, int16_t block[12][64], |
|
|
|
|
if(HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_FRAME) { |
|
|
|
|
if (s->mv_dir & MV_DIR_FORWARD) { |
|
|
|
|
ff_thread_await_progress(&s->last_picture_ptr->tf, |
|
|
|
|
ff_MPV_lowest_referenced_row(s, 0), |
|
|
|
|
ff_mpv_lowest_referenced_row(s, 0), |
|
|
|
|
0); |
|
|
|
|
} |
|
|
|
|
if (s->mv_dir & MV_DIR_BACKWARD) { |
|
|
|
|
ff_thread_await_progress(&s->next_picture_ptr->tf, |
|
|
|
|
ff_MPV_lowest_referenced_row(s, 1), |
|
|
|
|
ff_mpv_lowest_referenced_row(s, 1), |
|
|
|
|
0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -3027,12 +3027,12 @@ void MPV_decode_mb_internal(MpegEncContext *s, int16_t block[12][64], |
|
|
|
|
op_pix = s->hdsp.put_no_rnd_pixels_tab; |
|
|
|
|
} |
|
|
|
|
if (s->mv_dir & MV_DIR_FORWARD) { |
|
|
|
|
ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix, op_qpix); |
|
|
|
|
ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix, op_qpix); |
|
|
|
|
op_pix = s->hdsp.avg_pixels_tab; |
|
|
|
|
op_qpix= s->me.qpel_avg; |
|
|
|
|
} |
|
|
|
|
if (s->mv_dir & MV_DIR_BACKWARD) { |
|
|
|
|
ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix, op_qpix); |
|
|
|
|
ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix, op_qpix); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -3156,15 +3156,16 @@ skip_idct: |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]){ |
|
|
|
|
void ff_mpv_decode_mb(MpegEncContext *s, int16_t block[12][64]) |
|
|
|
|
{ |
|
|
|
|
#if !CONFIG_SMALL |
|
|
|
|
if(s->out_format == FMT_MPEG1) { |
|
|
|
|
if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1, 1); |
|
|
|
|
else MPV_decode_mb_internal(s, block, 0, 1); |
|
|
|
|
if(s->avctx->lowres) mpv_decode_mb_internal(s, block, 1, 1); |
|
|
|
|
else mpv_decode_mb_internal(s, block, 0, 1); |
|
|
|
|
} else |
|
|
|
|
#endif |
|
|
|
|
if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1, 0); |
|
|
|
|
else MPV_decode_mb_internal(s, block, 0, 0); |
|
|
|
|
if(s->avctx->lowres) mpv_decode_mb_internal(s, block, 1, 0); |
|
|
|
|
else mpv_decode_mb_internal(s, block, 0, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h) |
|
|
|
@ -3280,7 +3281,7 @@ void ff_set_qscale(MpegEncContext * s, int qscale) |
|
|
|
|
s->c_dc_scale= s->c_dc_scale_table[ s->chroma_qscale ]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ff_MPV_report_decode_progress(MpegEncContext *s) |
|
|
|
|
void ff_mpv_report_decode_progress(MpegEncContext *s) |
|
|
|
|
{ |
|
|
|
|
if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->er.error_occurred) |
|
|
|
|
ff_thread_report_progress(&s->current_picture_ptr->tf, s->mb_y, 0); |
|
|
|
|