# HG changeset patch # User michaelni # Date 1059180586 0 # Node ID b120aed7bf84970b480fa77de112d1338b43c903 # Parent f0d3fdee007e6339d0e76acda8ae55828d60657a ati vcr2 uv swap diff -r f0d3fdee007e -r b120aed7bf84 mpeg12.c --- a/mpeg12.c Fri Jul 25 13:36:08 2003 +0000 +++ b/mpeg12.c Sat Jul 26 00:49:46 2003 +0000 @@ -1791,6 +1791,12 @@ } } +static void exchange_uv(AVFrame *f){ + uint8_t *t= f->data[1]; + f->data[1]= f->data[2]; + f->data[2]= t; +} + #define DECODE_SLICE_FATAL_ERROR -2 #define DECODE_SLICE_ERROR -1 #define DECODE_SLICE_OK 0 @@ -1945,8 +1951,14 @@ MPV_decode_mb(s, s->block); if (++s->mb_x >= s->mb_width) { + if(s->avctx->codec_tag == ff_get_fourcc("VCR2")) + exchange_uv((AVFrame*)s->current_picture_ptr); + ff_draw_horiz_band(s, 16*s->mb_y, 16); + if(s->avctx->codec_tag == ff_get_fourcc("VCR2")) + exchange_uv((AVFrame*)s->current_picture_ptr); + s->mb_x = 0; s->mb_y++; @@ -2033,6 +2045,9 @@ ff_print_debug_info(s, s->last_picture_ptr); } } + if(s->avctx->codec_tag == ff_get_fourcc("VCR2")) + exchange_uv(pict); + return 1; } else { return 0; @@ -2164,6 +2179,7 @@ s->width = avctx->width; s->height = avctx->height; avctx->has_b_frames= 0; //true? + s->low_delay= 1; s->avctx = avctx; if (MPV_common_init(s) < 0)