FFMPEG 内部 YUV444p16LE-> P016LE
y 方向直接复制
1. hscale
2. vscale
static void yuv2p016cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest8, int chrDstW) { uint16_t *dest = (uint16_t*)dest8; const int32_t **uSrc = (const int32_t **)chrUSrc; const int32_t **vSrc = (const int32_t **)chrVSrc; int shift = 15; int big_endian = c->dstFormat == AV_PIX_FMT_P016BE; int i, j; for (i = 0; i < chrDstW; i++) { int u = 1 << (shift - 1); int v = 1 << (shift - 1); /* See yuv2planeX_16_c_template for details. */ u -= 0x40000000; v -= 0x40000000; for (j = 0; j < chrFilterSize; j++) { u += uSrc[j][i] * (unsigned)chrFilter[j]; v += vSrc[j][i] * (unsigned)chrFilter[j]; } output_pixel(&dest[2*i] , u, 0x8000, int); output_pixel(&dest[2*i+1], v, 0x8000, int); } }
FFMPEG YUV444P16LE -> P010 过程
yuv2plane1:0x4ba510 <ff_yuv2plane1_16_avx> y
yuv2planeX:0x4b9af0 <ff_yuv2planeX_16_sse4>
yuv2nv12cX:0x47f820 <yuv2p016cX_c> y chrFilter = {2048, 1786, 492, -172, -58, 0, 0, 0} int32_t in = 187709 ... ...
hyScale:0x4c7200 <ff_hscale16to19_4_sse4> y
hcScale:0x4c7290 <ff_hscale16to19_8_sse4> y
yuv2plane1 = 0x480860 <yuv2p010l1_LE_c>
yuv2planeX = 0x4a6580 <yuv2p010lX_LE_c>
yuv2nv12cX = 0x4806e0 <yuv2p010cX_c>
hyScale = 0x4c5520 <ff_hscale16to15_4_ssse3>
hcScale = 0x4c55a0 <ff_hscale16to15_8_ssse3>