comparison dsputil.c @ 1329:2114c1e206e8 libavcodec

Fix third pixel motion compensation
author tmmm
date Fri, 27 Jun 2003 15:03:58 +0000
parents 7d328fd9d8a5
children 8ffd0c00e6df
comparison
equal deleted inserted replaced
1328:ca3122e0a3cd 1329:2114c1e206e8
997 997
998 static inline void put_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){ 998 static inline void put_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
999 int i,j; 999 int i,j;
1000 for (i=0; i < height; i++) { 1000 for (i=0; i < height; i++) {
1001 for (j=0; j < width; j++) { 1001 for (j=0; j < width; j++) {
1002 dst[j] = (2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15; 1002 dst[j] = (2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
1003 } 1003 }
1004 src += stride; 1004 src += stride;
1005 dst += stride; 1005 dst += stride;
1006 } 1006 }
1007 } 1007 }
1019 1019
1020 static inline void put_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){ 1020 static inline void put_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
1021 int i,j; 1021 int i,j;
1022 for (i=0; i < height; i++) { 1022 for (i=0; i < height; i++) {
1023 for (j=0; j < width; j++) { 1023 for (j=0; j < width; j++) {
1024 dst[j] = (2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15; 1024 dst[j] = (2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
1025 } 1025 }
1026 src += stride; 1026 src += stride;
1027 dst += stride; 1027 dst += stride;
1028 } 1028 }
1029 } 1029 }
1094 1094
1095 static inline void avg_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){ 1095 static inline void avg_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
1096 int i,j; 1096 int i,j;
1097 for (i=0; i < height; i++) { 1097 for (i=0; i < height; i++) {
1098 for (j=0; j < width; j++) { 1098 for (j=0; j < width; j++) {
1099 dst[j] = (dst[j] + ((2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15) + 1) >> 1; 1099 dst[j] = (dst[j] + ((2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
1100 } 1100 }
1101 src += stride; 1101 src += stride;
1102 dst += stride; 1102 dst += stride;
1103 } 1103 }
1104 } 1104 }
1116 1116
1117 static inline void avg_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){ 1117 static inline void avg_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
1118 int i,j; 1118 int i,j;
1119 for (i=0; i < height; i++) { 1119 for (i=0; i < height; i++) {
1120 for (j=0; j < width; j++) { 1120 for (j=0; j < width; j++) {
1121 dst[j] = (dst[j] + ((2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15) + 1) >> 1; 1121 dst[j] = (dst[j] + ((2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
1122 } 1122 }
1123 src += stride; 1123 src += stride;
1124 dst += stride; 1124 dst += stride;
1125 } 1125 }
1126 } 1126 }