?? colorspace.c
字號:
#include "../../../fmpeg4_driver/fmpeg4.h"#include "colorspace.h"#include "../divx4.h" // DEC_PICTURE// function pointerscolor_outputFuncPtr yv12_to_yuv;#define MIN(A,B) ((A)<(B)?(A):(B))#define MAX(A,B) ((A)>(B)?(A):(B))#define SCALEBITS_IN 8#define FIX_IN(x) ((uint16_t) ((x) * (1L<<SCALEBITS_IN) + 0.5))/* yuv 4:2:0 planar -> yuv planar */voidyv12_to_yuv_c(uint8_t * dst, int dst_stride, uint8_t * y_src, uint8_t * u_src, uint8_t * v_src, int y_stride, int uv_stride, int width, int height){ uint32_t dst_stride2 = dst_stride >> 1; uint32_t width2 = width >> 1; uint32_t y; if (height < 0) { height = -height; y_src += (height - 1) * y_stride; u_src += (height / 2 - 1) * uv_stride; v_src += (height / 2 - 1) * uv_stride; y_stride = -y_stride; uv_stride = -uv_stride; } for (y = height; y; y--) { memcpy(dst, y_src, width); dst += dst_stride; y_src += y_stride; } for (y = height >> 1; y; y--) { memcpy(dst, u_src, width2); dst += dst_stride2; u_src += uv_stride; } for (y = height >> 1; y; y--) { memcpy(dst, v_src, width2); dst += dst_stride2; v_src += uv_stride; }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -