⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 colorspace.c

📁 基于Linux的ffmepg decoder
💻 C
字号:
#include <string.h>				// memcpy#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;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -