Ticket #5923: ycc.diff
| File ycc.diff, 4.5 KB (added by , 7 years ago) |
|---|
-
libavutil/pixdesc.c
646 646 }, 647 647 .flags = PIX_FMT_BE, 648 648 }, 649 [PIX_FMT_YCC420P] = { 650 .name = "ycc420p", 651 .nb_components= 3, 652 .log2_chroma_w= 1, 653 .log2_chroma_h= 1, 654 .comp = { 655 {0,0,1,0,7}, /* Y */ 656 {1,0,1,0,7}, /* U */ 657 {2,0,1,0,7}, /* V */ 658 }, 659 }, 649 660 }; 650 661 651 662 int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc) -
libavutil/pixfmt.h
124 124 PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian 125 125 PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian 126 126 PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers 127 128 PIX_FMT_YCC420P, ///< planar YCC 4:2:0, 12bpp (close to YUV420P but with a different colorspace conversion) 127 129 PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions 128 130 }; 129 131 -
libswscale/yuv2rgb.c
38 38 extern const uint8_t dither_8x8_73[8][8]; 39 39 extern const uint8_t dither_8x8_220[8][8]; 40 40 41 const int32_t ff_yuv2rgb_coeffs[ 8][4] = {41 const int32_t ff_yuv2rgb_coeffs[9][4] = { 42 42 {117504, 138453, 13954, 34903}, /* no sequence_display_extension */ 43 43 {117504, 138453, 13954, 34903}, /* ITU-R Rec. 709 (1990) */ 44 44 {104597, 132201, 25675, 53279}, /* unspecified */ … … 46 46 {104448, 132798, 24759, 53109}, /* FCC */ 47 47 {104597, 132201, 25675, 53279}, /* ITU-R Rec. 624-4 System B, G */ 48 48 {104597, 132201, 25675, 53279}, /* SMPTE 170M */ 49 {117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */ 49 {117579, 136230, 16907, 35559}, /* SMPTE 240M (1987) */ 50 {119374, 145352, 28198, 73984}, /* Kodak PhotoCD YCC */ 50 51 }; 51 52 52 53 #define LOADCHROMA(i) \ -
libswscale/swscale.c
156 156 || (x)==PIX_FMT_YUV420P16BE \ 157 157 || (x)==PIX_FMT_YUV422P16BE \ 158 158 || (x)==PIX_FMT_YUV444P16BE \ 159 || (x)==PIX_FMT_YCC420P \ 159 160 ) 160 161 161 162 int sws_isSupportedInput(enum PixelFormat pix_fmt) … … 2406 2407 int usesVFilter, usesHFilter; 2407 2408 int unscaled, needsDither; 2408 2409 int srcRange, dstRange; 2410 int srcColorspace; 2409 2411 SwsFilter dummyFilter= {NULL, NULL, NULL, NULL}; 2410 2412 #if ARCH_X86 2411 2413 if (flags & SWS_CPU_CAPS_MMX) … … 2434 2436 && (fmt_depth(dstFormat))<24 2435 2437 && ((fmt_depth(dstFormat))<(fmt_depth(srcFormat)) || (!(isRGB(srcFormat) || isBGR(srcFormat)))); 2436 2438 2439 switch (srcFormat) { 2440 case PIX_FMT_YCC420P: 2441 srcFormat == PIX_FMT_YUV420P; 2442 srcColorspace = SWS_CS_KODAKPHOTOYCC; 2443 break; 2444 default: 2445 srcColorspace = SWS_CS_DEFAULT; 2446 break; 2447 } 2448 2437 2449 srcRange = handle_jpeg(&srcFormat); 2438 2450 dstRange = handle_jpeg(&dstFormat); 2439 2451 … … 2532 2544 c->chrDstW= -((-dstW) >> c->chrDstHSubSample); 2533 2545 c->chrDstH= -((-dstH) >> c->chrDstVSubSample); 2534 2546 2535 sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[ SWS_CS_DEFAULT], srcRange, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/, dstRange, 0, 1<<16, 1<<16);2547 sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[srcColorspace], srcRange, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/, dstRange, 0, 1<<16, 1<<16); 2536 2548 2537 2549 /* unscaled special cases */ 2538 2550 if (unscaled && !usesHFilter && !usesVFilter && (srcRange == dstRange || isBGR(dstFormat) || isRGB(dstFormat))) { -
libswscale/swscale.h
101 101 #define SWS_CS_ITU624 5 102 102 #define SWS_CS_SMPTE170M 5 103 103 #define SWS_CS_SMPTE240M 7 104 #define SWS_CS_KODAKPHOTOYCC 8 104 105 #define SWS_CS_DEFAULT 5 105 106 106 107
