h264: put visualization and debug support back
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 19 Feb 2013 01:47:47 +0000 (02:47 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 19 Feb 2013 01:56:31 +0000 (02:56 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/h264.c
libavcodec/h264.h

index ba16b2f..fe12846 100644 (file)
@@ -1003,6 +1003,9 @@ static void free_tables(H264Context *h, int free_rbsp)
     av_freep(&h->mb2b_xy);
     av_freep(&h->mb2br_xy);
 
+    for (i = 0; i < 3; i++)
+        av_freep(&h->visualization_buffer[i]);
+
     if (free_rbsp) {
         for (i = 0; i < h->picture_count && !h->avctx->internal->is_copy; i++)
             free_picture(h, &h->DPB[i]);
@@ -4781,6 +4784,9 @@ not_extra:
 
     assert(pict->data[0] || !*got_frame);
 
+    ff_print_debug_info2(h->avctx, pict, h->er.mbskip_table, h->visualization_buffer, &h->low_delay,
+                         h->mb_width, h->mb_height, h->mb_stride, 1);
+
     return get_consumed_bytes(buf_index, buf_size);
 }
 
index cb69361..0c8c7ad 100644 (file)
@@ -644,6 +644,8 @@ typedef struct H264Context {
     int parse_last_mb;
     uint8_t *edge_emu_buffer;
     int16_t *dc_val_base;
+
+    uint8_t *visualization_buffer[3]; ///< temporary buffer vor MV visualization
 } H264Context;
 
 extern const uint8_t ff_h264_chroma_qp[7][QP_MAX_NUM + 1]; ///< One chroma qp table for each possible bit depth (8-14).