Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 1d7ef4c7b146d87100176c3d1e25a082654a0f00 Mon Sep 17 00:00:00 2001
- From: Oka Motofumi <chikuzen.mo@gmail.com>
- Date: Sat, 10 Dec 2011 11:37:42 +0900
- Subject: [PATCH] Change colorspace conversion when source is YUV440P/GBRP.
- It is unsuitable to convert YUV440 to YUY2 because chroma values are not
- shared horizontally on YUV440.
- ---
- lsmashinput.c | 8 +++++---
- 1 files changed, 5 insertions(+), 3 deletions(-)
- diff --git a/lsmashinput.c b/lsmashinput.c
- index 8e50f0a..6cb75ca 100644
- --- a/lsmashinput.c
- +++ b/lsmashinput.c
- @@ -313,9 +313,9 @@ static int to_yuv16le_to_yc48( lsmash_handler_t *hp, AVFrame *picture, uint8_t *
- {
- const int dst_linesize[4] =
- {
- - picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P),
- - picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P),
- - picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P),
- + picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P || hp->video_ctx->pix_fmt == PIX_FMT_YUV440P),
- + picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P || hp->video_ctx->pix_fmt == PIX_FMT_YUV444P),
- + picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P || hp->video_ctx->pix_fmt == PIX_FMT_YUV444P),
- 0
- };
- uint8_t *dst_data[4];
- @@ -466,6 +466,7 @@ static int prepare_video_decoding( lsmash_handler_t *hp, int threads )
- switch( hp->video_ctx->pix_fmt )
- {
- case PIX_FMT_YUV444P :
- + case PIX_FMT_YUV440P :
- case PIX_FMT_YUV420P9LE :
- case PIX_FMT_YUV420P9BE :
- case PIX_FMT_YUV422P9LE :
- @@ -524,6 +525,7 @@ static int prepare_video_decoding( lsmash_handler_t *hp, int threads )
- case PIX_FMT_RGB444BE :
- case PIX_FMT_BGR444LE :
- case PIX_FMT_BGR444BE :
- + case PIX_FMT_GBRP :
- hp->convert_colorspace = to_rgb24;
- hp->pixel_size = 3; /* BGR 8:8:8 */
- out_pix_fmt = PIX_FMT_BGR24; /* packed RGB 8:8:8, 24bpp, BGRBGR... */
- --
- 1.7.6.msysgit.0
Add Comment
Please, Sign In to add comment