Guest User

Untitled

a guest
Apr 24th, 2018
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.08 KB | None | 0 0
  1. From 1d7ef4c7b146d87100176c3d1e25a082654a0f00 Mon Sep 17 00:00:00 2001
  2. From: Oka Motofumi <chikuzen.mo@gmail.com>
  3. Date: Sat, 10 Dec 2011 11:37:42 +0900
  4. Subject: [PATCH] Change colorspace conversion when source is YUV440P/GBRP.
  5.  
  6. It is unsuitable to convert YUV440 to YUY2 because chroma values are not
  7. shared horizontally on YUV440.
  8. ---
  9. lsmashinput.c |    8 +++++---
  10.  1 files changed, 5 insertions(+), 3 deletions(-)
  11.  
  12. diff --git a/lsmashinput.c b/lsmashinput.c
  13. index 8e50f0a..6cb75ca 100644
  14. --- a/lsmashinput.c
  15. +++ b/lsmashinput.c
  16. @@ -313,9 +313,9 @@ static int to_yuv16le_to_yc48( lsmash_handler_t *hp, AVFrame *picture, uint8_t *
  17.  {
  18.      const int dst_linesize[4] =
  19.          {
  20. -            picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P),
  21. -            picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P),
  22. -            picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P),
  23. +            picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P || hp->video_ctx->pix_fmt == PIX_FMT_YUV440P),
  24. +            picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P || hp->video_ctx->pix_fmt == PIX_FMT_YUV444P),
  25. +            picture->linesize[0] << (hp->video_ctx->pix_fmt == PIX_FMT_YUV444P || hp->video_ctx->pix_fmt == PIX_FMT_YUV444P),
  26.              0
  27.          };
  28.      uint8_t *dst_data[4];
  29. @@ -466,6 +466,7 @@ static int prepare_video_decoding( lsmash_handler_t *hp, int threads )
  30.      switch( hp->video_ctx->pix_fmt )
  31.      {
  32.          case PIX_FMT_YUV444P :
  33. +        case PIX_FMT_YUV440P :
  34.          case PIX_FMT_YUV420P9LE :
  35.          case PIX_FMT_YUV420P9BE :
  36.          case PIX_FMT_YUV422P9LE :
  37. @@ -524,6 +525,7 @@ static int prepare_video_decoding( lsmash_handler_t *hp, int threads )
  38.          case PIX_FMT_RGB444BE :
  39.          case PIX_FMT_BGR444LE :
  40.          case PIX_FMT_BGR444BE :
  41. +        case PIX_FMT_GBRP :
  42.              hp->convert_colorspace = to_rgb24;
  43.              hp->pixel_size         = 3;                     /* BGR 8:8:8 */
  44.              out_pix_fmt            = PIX_FMT_BGR24;         /* packed RGB 8:8:8, 24bpp, BGRBGR... */
  45. --
  46. 1.7.6.msysgit.0
Add Comment
Please, Sign In to add comment