deblock_vert.c
上传用户:tuheem
上传日期:2007-05-01
资源大小:21889k
文件大小:3k
- #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
- };
- }