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

📄 jdoutput.c

📁 void III_hufman_decode(struct Granule *gr,int part2_start, int freqline[SBLIMIT][SSLIMIT]) {
💻 C
字号:
#include "jdconfig.h"
#include "jddatatype.h"

void copy_output (UINT32 *image_buffer, UINT32 *external_image_buffer,
					UINT16 number_of_samples_per_line,
					UINT16 number_of_rows, UINT16 number_of_columns, UINT16 image_format)
{
	UINT16 i, j;

	number_of_samples_per_line &= 0xfffe;
	number_of_columns &= 0x1e;

	for (i=0; i<number_of_rows; i++)
	{
		for (j=0; j<(number_of_columns >> 1); j++)
			*external_image_buffer++ = *image_buffer++;

		if (image_format == FOUR_ZERO_ZERO || image_format == FOUR_FOUR_FOUR)
			image_buffer += 4 - (number_of_columns >> 1);
 		else
			image_buffer += 8 - (number_of_columns >> 1);

		external_image_buffer += (number_of_samples_per_line - number_of_columns) >> 1;
	}
}


void write_400_format (INT16 * mcu_buffer, UINT32 * image_buffer)
{
	UINT8 i, j;
	UINT16 * ptr;
	INT16 * y;

	y = mcu_buffer;

	ptr = (UINT16 *) image_buffer;

	for (i = 0; i < 8; i ++)
	{
		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y ++) << 8) + 0x80 ;
			*ptr ++ = ((* y ++) << 8) + 0x80 ;
		}
	}
}

void write_420_format (INT16 * mcu_buffer, UINT32 * image_buffer)
{
	UINT8 i, j;
	UINT16 * ptr;
	INT16 * y1, * y2, * y3, * y4, * cb, * cr;

	y1 = mcu_buffer;
	y2 = mcu_buffer + 64;
	y3 = mcu_buffer + 128;
	y4 = mcu_buffer + 192;
	cb = mcu_buffer + 256;
	cr = mcu_buffer + 320;

	ptr = (UINT16 *) image_buffer;

	for (i = 0; i < 4; i ++)
	{
		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y1 ++) << 8) + (* cb ++) ;
			*ptr ++ = ((* y1 ++) << 8) + (* cr ++) ;
		}

		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y2 ++) << 8) + (* cb ++) ;
			*ptr ++ = ((* y2 ++) << 8) + (* cr ++) ;
		}

		cb -= 8;
		cr -= 8;

		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y1 ++) << 8) + (* cb ++) ;
			*ptr ++ = ((* y1 ++) << 8) + (* cr ++) ;
		}

		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y2 ++) << 8) + (* cb ++) ;
			*ptr ++ = ((* y2 ++) << 8) + (* cr ++) ;
		}
	}

	for (i = 0; i < 4; i ++)
	{
		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y3 ++) << 8) + (* cb ++) ;
			*ptr ++ = ((* y3 ++) << 8) + (* cr ++) ;
		}

		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y4 ++) << 8) + (* cb ++) ;
			*ptr ++ = ((* y4 ++) << 8) + (* cr ++) ;
		}

		cb -= 8;
		cr -= 8;

		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y3 ++) << 8) + (* cb ++) ;
			*ptr ++ = ((* y3 ++) << 8) + (* cr ++) ;
		}

		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y4 ++) << 8) + (* cb ++) ;
			*ptr ++ = ((* y4 ++) << 8) + (* cr ++) ;
		}
	}
}

void write_422_format (INT16 * mcu_buffer, UINT32 * image_buffer)
{
	UINT8 i, j;
	UINT16 * ptr;
	INT16 * y1, * y2, * cb, * cr;
	
	y1 = mcu_buffer;
	y2 = mcu_buffer + 64;
	cb = mcu_buffer + 128;
	cr = mcu_buffer + 192;

	ptr = (UINT16 *) image_buffer;

	for (i = 0; i < 8; i ++)
	{
		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y1 ++) << 8) + (* cb ++) ;
			*ptr ++ = ((* y1 ++) << 8) + (* cr ++) ;
		}

		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y2 ++) << 8) + (* cb ++) ;
			*ptr ++ = ((* y2 ++) << 8) + (* cr ++) ;
		}
	}
}

void write_444_format (INT16 * mcu_buffer, UINT32 * image_buffer)
{
	UINT8 i, j;
	UINT16 * ptr;
	INT16 * y, * cb, * cr;

	y = mcu_buffer;
	cb = mcu_buffer + 64;
	cr = mcu_buffer + 128;

	ptr = (UINT16 *) image_buffer;

	for (i = 0; i < 8; i ++)
	{
		for (j = 0; j < 4; j ++)
		{
			*ptr ++ = ((* y ++) << 8) + (* cb ++) ;
			*ptr ++ = ((* y ++) << 8) + (* cr ++) ;

			cb ++;
			cr ++;
		}
	}
}

⌨️ 快捷键说明

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