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

📄 deblock_vert.c

📁 VC++视频开发实例集锦(包括“远程视频监控”"语音识别系统"等13个经典例子)
💻 C
字号:

#include "postprocess_mmx.h"


#ifdef PP_COMPONENTS_INLINE
 #ifndef INLINE
 #define INLINE static __inline
 #endif
 #include "deblock_vert_DC_on.c"
 #include "deblock_vert_choose_p1p2.c"
 #include "deblock_vert_copy_and_unpack.c"
 #include "deblock_vert_default_filter.c"
 #include "deblock_vert_lpf9.c"
 #include "deblock_vert_useDC.c"
#endif


void deblock_vert( uint8_t *image, int width, int stride, QP_STORE_T *QP_store, int QP_stride, int chromaFlag) {
	uint64_t v_local[20];
	uint64_t p1p2[4];
	int Bx, x, y;
	int QP, QPx16;
	uint8_t *v;
	int useDC, DC_on;
	#ifdef PREFETCH_AHEAD_V
	void *prefetch_addr;
	#endif

	y = 0;
	
		for (Bx=0; Bx<width; Bx+=8) {

			QP = chromaFlag ? QP_store[y/8*QP_stride+Bx/8]
			                : QP_store[y/16*QP_stride+Bx/16];	
			QPx16 = 16 * QP;
			v = &(image[y*stride + Bx]) - 5*stride;

			#ifdef PREFETCH_AHEAD_V
			prefetch_addr = v + PREFETCH_AHEAD_V;
			__asm {
				push eax
				push ebx
				mov eax, prefetch_addr
				mov ebx, stride
				add      eax , ebx        /* prefetch_addr+= stride */
				prefetcht0 [eax]           
				add      eax , ebx        /* prefetch_addr+= stride */
				prefetcht0 [eax]           
				add      eax , ebx        /* prefetch_addr+= stride */
				prefetcht0 [eax]           
				add      eax , ebx        /* prefetch_addr+= stride */
				prefetcht0 [eax]           
				add      eax , ebx        /* prefetch_addr+= stride */
				prefetcht0 [eax]           
				add      eax , ebx        /* prefetch_addr+= stride */
				prefetcht0 [eax]           
				add      eax , ebx        /* prefetch_addr+= stride */
				prefetcht0 [eax]           
				add      eax , ebx        /* prefetch_addr+= stride */
				prefetcht0 [eax]           
				pop ebx
				pop eax
			};
			#endif

			useDC = deblock_vert_useDC(v, stride);
						
			if (useDC) {
 				DC_on = deblock_vert_DC_on(v, stride, QP);
				
				if (DC_on) { 
				
						v = &(image[y*stride + Bx])- 5*stride;
						
						deblock_vert_copy_and_unpack(stride, &(v[stride]), &(v_local[2]), 8);

						deblock_vert_choose_p1p2(v, stride, p1p2, QP);
					
						deblock_vert_lpf9(v_local, p1p2, v, stride); 

						#ifdef SHOWDECISIONS_V
						if (!chromaFlag) {
							v[4*stride  ] = 
							v[4*stride+1] = 
							v[4*stride+2] = 
							v[4*stride+3] = 
							v[4*stride+4] = 
							v[4*stride+5] = 
							v[4*stride+6] = 
							v[4*stride+7] = 255;
						}  
						#endif
					}
			}

			if (!useDC) { 
		
					x = Bx;
					v = &(image[y*stride + x])- 5*stride;
			
					deblock_vert_default_filter(v, stride, QP);

				#ifdef SHOWDECISIONS_V
				if (!chromaFlag) {
					v[4*stride  ] = 
					v[4*stride+1] = 
					v[4*stride+2] = 
					v[4*stride+3] = 
					v[4*stride+4] = 
					v[4*stride+5] = 
					v[4*stride+6] = 
					v[4*stride+7] = 0;
				}  
				#endif
			}
		} 
	__asm { 
		emms
	};
}






⌨️ 快捷键说明

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