deblock_vert_DC_on.c
资源名称:VC++视频传输.rar [点击查看]
上传用户:hxb_1234
上传日期:2010-03-30
资源大小:8328k
文件大小:1k
源码类别:
VC书籍
开发平台:
Visual C++
- #include "postprocess_mmx.h"
- INLINE int deblock_vert_DC_on(uint8_t *v, int stride, int QP) {
- uint64_t QP_x_2;
- uint8_t *ptr1;
- uint8_t *ptr2;
- int DC_on;
- #ifdef PP_SELF_CHECK
- int i, DC_on2;
- #endif
- ptr1 = &(v[1*stride]);
- ptr2 = &(v[8*stride]);
- #ifdef PP_SELF_CHECK
- DC_on2 = 1;
- for (i=0; i<8; i++) {
- if (ABS(v[i+1*stride]-v[i+8*stride]) > 2 *QP) DC_on2 = 0;
- }
- #endif
- ((uint32_t *)(&QP_x_2))[0] =
- ((uint32_t *)(&QP_x_2))[1] = 0x02020202 * QP;
- __asm {
- push eax
- push ebx
- mov eax, ptr1
- mov ebx, ptr2
- movq mm0, [eax] /* mm0 = v[l1] */
- movq mm1, mm0 /* mm1 = v[l1] */
- movq mm2, [ebx] /* mm2 = v[l8] */
- psubusb mm0, mm2 /* mm0 -= mm2 */
- psubusb mm2, mm1 /* mm2 -= mm1 */
- por mm0, mm2 /* mm0 |= mm2 */
- psubusb mm0, QP_x_2 /* mm0 -= 2 * QP */
- movq mm1, mm0 /* mm1 = mm0 */
- psrlq mm0, 32 /* shift mm0 right 32 bits */
- por mm0, mm1 /* */
- movd DC_on, mm0
- pop ebx
- pop eax
- };
- DC_on = !DC_on;
- #ifdef PP_SELF_CHECK
- if (DC_on != DC_on2) {
- printf("ERROR: MMX version of DC_on is incorrectn");
- }
- #endif
- return DC_on;
- }