deblock_horiz.c
资源名称:VC++视频传输.rar [点击查看]
上传用户:hxb_1234
上传日期:2010-03-30
资源大小:8328k
文件大小:2k
源码类别:
VC书籍
开发平台:
Visual C++
- #include "postprocess_mmx.h"
- #ifdef PP_COMPONENTS_INLINE
- #ifndef INLINE
- #define INLINE static __inline
- #endif
- #include "deblock_horiz_DC_on.c"
- #include "deblock_horiz_useDC.c"
- #include "deblock_horiz_default_filter.c"
- #include "deblock_horiz_lpf9.c"
- #endif
- void deblock_horiz(uint8_t *image, int width, int stride, QP_STORE_T *QP_store, int QP_stride, int chromaFlag) {
- int x, y;
- int QP;
- uint8_t *v;
- int useDC, DC_on;
- #ifdef PREFETCH_AHEAD_H
- void *prefetch_addr;
- #endif
- y = 0;
- for (x=8; x<width; x+=8) {
- QP = chromaFlag ? QP_store[y/8*QP_stride+x/8]
- : QP_store[y/16*QP_stride+x/16];
- v = &(image[y*stride + x]) - 5;
- #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
- prefetcht0 [eax]
- add eax , ebx
- prefetcht0 [eax]
- add eax , ebx
- prefetcht0 [eax]
- add eax , ebx
- prefetcht0 [eax]
- pop ebx
- pop eax
- };
- #endif
- useDC = deblock_horiz_useDC(v, stride);
- if (useDC) {
- DC_on = deblock_horiz_DC_on(v, stride, QP);
- if (DC_on) {
- deblock_horiz_lpf9(v, stride, QP);
- #ifdef SHOWDECISIONS_H
- if (!chromaFlag) {
- v[0*stride + 4] =
- v[1*stride + 4] =
- v[2*stride + 4] =
- v[3*stride + 4] = 255;
- }
- #endif
- }
- } else {
- deblock_horiz_default_filter(v, stride, QP);
- #ifdef SHOWDECISIONS_H
- if (!chromaFlag) {
- v[0*stride + 4] =
- v[1*stride + 4] =
- v[2*stride + 4] =
- v[3*stride + 4] = 0;
- }
- #endif
- }
- }
- __asm {
- emms
- };
- }