# HG changeset patch # User reimar # Date 1275720301 0 # Node ID e888e262e3f05234e1209888e5600097a61b6f36 # Parent b470391059f3c692aee19561f36d152a6c5cf78d Remove colorspace conversion code from -vo yuv4mpeg, -vf scale should be able to handle this just as well (or better) including interlaced. If not, this needs to be fixed there instead of duplicating code. diff -r b470391059f3 -r e888e262e3f0 DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 Sat Jun 05 06:41:43 2010 +0000 +++ b/DOCS/man/en/mplayer.1 Sat Jun 05 06:45:01 2010 +0000 @@ -4349,7 +4349,9 @@ images and stores it in a file (default: ./stream.yuv). The format is the same as the one employed by mjpegtools, so this is useful if you want to process the video with the mjpegtools suite. -It supports the YV12, RGB (24 bpp) and BGR (24 bpp) format. +It supports the YV12 format. +If your source file has a different format and is interlaced, make sure +to use -vf scale=::1 to ensure the conversion uses interlaced mode. You can combine it with the \-fixed\-vo option to concatenate files with the same dimensions and fps value. .PD 0 diff -r b470391059f3 -r e888e262e3f0 help/help_mp-en.h --- a/help/help_mp-en.h Sat Jun 05 06:41:43 2010 +0000 +++ b/help/help_mp-en.h Sat Jun 05 06:45:01 2010 +0000 @@ -1110,9 +1110,7 @@ // vo_yuv4mpeg.c #define MSGTR_VO_YUV4MPEG_InterlacedHeightDivisibleBy4 "Interlaced mode requires image height to be divisible by 4." #define MSGTR_VO_YUV4MPEG_InterlacedLineBufAllocFail "Unable to allocate line buffer for interlaced mode." -#define MSGTR_VO_YUV4MPEG_InterlacedInputNotRGB "Input not RGB, can't separate chrominance by fields!" #define MSGTR_VO_YUV4MPEG_WidthDivisibleBy2 "Image width must be divisible by 2." -#define MSGTR_VO_YUV4MPEG_NoMemRGBFrameBuf "Not enough memory to allocate RGB framebuffer." #define MSGTR_VO_YUV4MPEG_OutFileOpenError "Can't get memory or file handle to write \"%s\"!" #define MSGTR_VO_YUV4MPEG_OutFileWriteError "Error writing image to output!" #define MSGTR_VO_YUV4MPEG_UnknownSubDev "Unknown subdevice: %s" diff -r b470391059f3 -r e888e262e3f0 libvo/vo_yuv4mpeg.c --- a/libvo/vo_yuv4mpeg.c Sat Jun 05 06:41:43 2010 +0000 +++ b/libvo/vo_yuv4mpeg.c Sat Jun 05 06:45:01 2010 +0000 @@ -55,11 +55,6 @@ #include "sub.h" #include "fastmemcpy.h" -#include "libswscale/swscale.h" -#ifdef CONFIG_LIBSWSCALE_A -#include "libswscale/rgb2rgb.h" -#endif -#include "libmpcodecs/vf_scale.h" #include "libavutil/rational.h" static const vo_info_t info = @@ -81,9 +76,6 @@ static uint8_t *image_u = NULL; static uint8_t *image_v = NULL; -static uint8_t *rgb_buffer = NULL; -static uint8_t *rgb_line_buffer = NULL; - static char *yuv_filename = NULL; static int using_format = 0; @@ -128,18 +120,6 @@ MSGTR_VO_YUV4MPEG_InterlacedHeightDivisibleBy4); return -1; } - - rgb_line_buffer = malloc(image_width * 3); - if (!rgb_line_buffer) - { - mp_msg(MSGT_VO,MSGL_FATAL, - MSGTR_VO_YUV4MPEG_InterlacedLineBufAllocFail); - return -1; - } - - if (using_format == IMGFMT_YV12) - mp_msg(MSGT_VO,MSGL_WARN, - MSGTR_VO_YUV4MPEG_InterlacedInputNotRGB); } if (width % 2) @@ -149,20 +129,6 @@ return -1; } -#ifdef CONFIG_LIBSWSCALE_A - if(using_format != IMGFMT_YV12) - { - sws_rgb2rgb_init(get_sws_cpuflags()); - rgb_buffer = malloc(image_width * image_height * 3); - if (!rgb_buffer) - { - mp_msg(MSGT_VO,MSGL_FATAL, - MSGTR_VO_YUV4MPEG_NoMemRGBFrameBuf); - return -1; - } - } -#endif - write_bytes = image_width * image_height * 3 / 2; image = malloc(write_bytes); @@ -187,44 +153,10 @@ return 0; } -/* Only use when h divisable by 2! */ -static void swap_fields(uint8_t *ptr, const int h, const int stride) -{ - int i; - - for (i=0; i