[svn] / trunk / xvidcore / src / bitstream / cbp.c Repository:
ViewVC logotype

View of /trunk/xvidcore/src/bitstream/cbp.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 78 - (download) (annotate)
Thu Mar 28 20:57:25 2002 UTC (21 years, 11 months ago) by edgomez
File size: 537 byte(s)
Big patch, use it with care (tests done with GNU/Linux) :
 - Trivial warnings in encoder.c line 282 ret1 = ret 2 = 0;
 - Lot of "New line at end of file missing" warnings fixed (gcc3)
 - All 2d arrays have been turned into 1d arrays
   To force alignment of matrices on stack, use DECLARE_ALIGNED_MATRIX
   (read portab.h)

Win32 users should give feedback.
#include "../portab.h"
#include "cbp.h"

cbpFuncPtr calc_cbp;

/*
 * Returns a field of bits that indicates non zero ac blocks
 * for this macro block
 */
uint32_t calc_cbp_c(const int16_t codes[6*64])
{
	uint32_t i, j;
	uint32_t cbp = 0;

	for (i = 0; i < 6*64; i+=64)
	{
		for (j = 1; j < 61; j+=4)
		{
			if (codes[i + j    ]|codes[i + j + 1]|
			    codes[i + j + 2]|codes[i + j + 3])
			{
				cbp |= 1 << (5 - i);
				break;
			}
		}

		if(codes[i + j]|codes[i + j +1]|codes[i + j + 2])
			cbp |= 1 << (5 - i);

	}

	return cbp;

}

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4