mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 01:02:33 +00:00
avcodec/mpegutils: Don't output wrong mb skip values
The earlier code had two problems: 1. For reference frames that are not directly output (happens unless low_delay is set), the mb skip values referred to the next reference frame to be decoded. 2. For non-reference frames, every macroblock was always considered skipped. This makes the output (worse than) useless; that no one ever complained about this shows that this feature is not really used. It is therefore removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
b2195a238c
commit
952a32e9a0
@ -979,7 +979,7 @@ static int finalize_frame(H264Context *h, AVFrame *dst, H264Picture *out, int *g
|
||||
*got_frame = 1;
|
||||
|
||||
if (CONFIG_MPEGVIDEODEC) {
|
||||
ff_print_debug_info2(h->avctx, dst, NULL,
|
||||
ff_print_debug_info2(h->avctx, dst,
|
||||
out->mb_type,
|
||||
out->qscale_table,
|
||||
out->motion_val,
|
||||
|
@ -153,7 +153,7 @@ static char get_interlacement_char(int mb_type)
|
||||
}
|
||||
|
||||
void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict,
|
||||
const uint8_t *mbskip_table, const uint32_t *mbtype_table,
|
||||
const uint32_t *mbtype_table,
|
||||
const int8_t *qscale_table, int16_t (*const motion_val[2])[2],
|
||||
int mb_width, int mb_height, int mb_stride, int quarter_sample)
|
||||
{
|
||||
@ -248,7 +248,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict,
|
||||
return;
|
||||
|
||||
|
||||
if (avctx->debug & (FF_DEBUG_SKIP | FF_DEBUG_QP | FF_DEBUG_MB_TYPE)) {
|
||||
if (avctx->debug & (FF_DEBUG_QP | FF_DEBUG_MB_TYPE)) {
|
||||
int x,y;
|
||||
AVBPrint buf;
|
||||
int n;
|
||||
@ -267,8 +267,6 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict,
|
||||
av_bprint_chars(&buf, ' ', margin_left);
|
||||
|
||||
n = 0;
|
||||
if (avctx->debug & FF_DEBUG_SKIP)
|
||||
n++;
|
||||
if (avctx->debug & FF_DEBUG_QP)
|
||||
n += 2;
|
||||
if (avctx->debug & FF_DEBUG_MB_TYPE)
|
||||
@ -284,12 +282,6 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict,
|
||||
for (x = 0; x < mb_width; x++) {
|
||||
if (x == 0)
|
||||
av_bprintf(&buf, "%*d ", margin_left - 1, y << 4);
|
||||
if (avctx->debug & FF_DEBUG_SKIP) {
|
||||
int count = mbskip_table ? mbskip_table[x + y * mb_stride] : 0;
|
||||
if (count > 9)
|
||||
count = 9;
|
||||
av_bprintf(&buf, "%1d", count);
|
||||
}
|
||||
if (avctx->debug & FF_DEBUG_QP) {
|
||||
av_bprintf(&buf, "%2d", qscale_table[x + y * mb_stride]);
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ void ff_draw_horiz_band(AVCodecContext *avctx, const AVFrame *cur, const AVFrame
|
||||
* Print debugging info for the given picture.
|
||||
*/
|
||||
void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict,
|
||||
const uint8_t *mbskip_table, const uint32_t *mbtype_table,
|
||||
const uint32_t *mbtype_table,
|
||||
const int8_t *qscale_table, int16_t (*const motion_val[2])[2],
|
||||
int mb_width, int mb_height, int mb_stride, int quarter_sample);
|
||||
|
||||
|
@ -408,7 +408,7 @@ void ff_mpv_frame_end(MpegEncContext *s)
|
||||
|
||||
void ff_print_debug_info(const MpegEncContext *s, const MPVPicture *p, AVFrame *pict)
|
||||
{
|
||||
ff_print_debug_info2(s->avctx, pict, s->mbskip_table, p->mb_type,
|
||||
ff_print_debug_info2(s->avctx, pict, p->mb_type,
|
||||
p->qscale_table, p->motion_val,
|
||||
s->mb_width, s->mb_height, s->mb_stride, s->quarter_sample);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user