[cvs] / xvidcore / src / image / interpolate8x8.c Repository:
ViewVC logotype

Diff of /xvidcore/src/image/interpolate8x8.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4.2.2, Thu Oct 10 12:14:53 2002 UTC revision 1.4.2.6, Sat Jan 4 06:14:33 2003 UTC
# Line 31  Line 31 
31    
32    
33  #include "../portab.h"  #include "../portab.h"
34    #include "../global.h"
35  #include "interpolate8x8.h"  #include "interpolate8x8.h"
36    
37  // function pointers  // function pointers
# Line 53  Line 54 
54  INTERPOLATE8X8_6TAP_LOWPASS_PTR interpolate8x8_6tap_lowpass_h;  INTERPOLATE8X8_6TAP_LOWPASS_PTR interpolate8x8_6tap_lowpass_h;
55  INTERPOLATE8X8_6TAP_LOWPASS_PTR interpolate8x8_6tap_lowpass_v;  INTERPOLATE8X8_6TAP_LOWPASS_PTR interpolate8x8_6tap_lowpass_v;
56    
57  void interpolate8x8_avg2_c(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint32_t stride, const uint32_t rounding)  void interpolate8x8_avg2_c(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint32_t stride, const uint32_t rounding, const uint32_t height)
58  {  {
59      int32_t i;      uint32_t i;
60          const int32_t round = 1 - rounding;          const int32_t round = 1 - rounding;
61    
62      for(i = 0; i < 8; i++)      for(i = 0; i < height; i++)
63      {      {
64          dst[0] = (src1[0] + src2[0] + round) >> 1;          dst[0] = (src1[0] + src2[0] + round) >> 1;
65          dst[1] = (src1[1] + src2[1] + round) >> 1;          dst[1] = (src1[1] + src2[1] + round) >> 1;
# Line 167  Line 168 
168   * QPEL STUFF STARTS HERE                                    *   * QPEL STUFF STARTS HERE                                    *
169   *************************************************************/   *************************************************************/
170    
 #define CLIP(X,A,B) (X < A) ? (A) : ((X > B) ? (B) : (X))  
   
171  void interpolate8x8_6tap_lowpass_h_c(uint8_t *dst, uint8_t *src, int32_t stride, int32_t rounding)  void interpolate8x8_6tap_lowpass_h_c(uint8_t *dst, uint8_t *src, int32_t stride, int32_t rounding)
172  {  {
173      int32_t i;      int32_t i;
# Line 196  Line 195 
195      int32_t i;      int32_t i;
196          uint8_t round_add = 16 - rounding;          uint8_t round_add = 16 - rounding;
197    
198      for(i = 0; i < 16; i++)      for(i = 0; i < 17; i++)
199      {      {
200    
201          dst[0] = CLIP(((7 * ((src[0]<<1) - src[2]) +  23 * src[1] + 3 * src[3] - src[4] + round_add) >> 5), 0, 255);          dst[0] = CLIP(((7 * ((src[0]<<1) - src[2]) +  23 * src[1] + 3 * src[3] - src[4] + round_add) >> 5), 0, 255);
# Line 228  Line 227 
227      int32_t i;      int32_t i;
228          uint8_t round_add = 16 - rounding;          uint8_t round_add = 16 - rounding;
229    
230      for(i = 0; i < 8; i++)      for(i = 0; i < 9; i++)
231      {      {
232    
233          dst[0] = CLIP(((7 * ((src[0]<<1) - src[2]) + 23 * src[1] + 3 * src[3] - src[4] + round_add) >> 5), 0, 255);          dst[0] = CLIP(((7 * ((src[0]<<1) - src[2]) + 23 * src[1] + 3 * src[3] - src[4] + round_add) >> 5), 0, 255);
# Line 285  Line 284 
284      int32_t i;      int32_t i;
285          uint8_t round_add = 16 - rounding;          uint8_t round_add = 16 - rounding;
286    
287      for(i = 0; i < 16; i++)      for(i = 0; i < 17; i++)
288      {      {
289          int32_t src0 = src[0];          int32_t src0 = src[0];
290          int32_t src1 = src[stride];          int32_t src1 = src[stride];
# Line 335  Line 334 
334      int32_t i;      int32_t i;
335          uint8_t round_add = 16 - rounding;          uint8_t round_add = 16 - rounding;
336    
337      for(i = 0; i < 8; i++)      for(i = 0; i < 9; i++)
338      {      {
339          int32_t src0 = src[0];          int32_t src0 = src[0];
340          int32_t src1 = src[stride];          int32_t src1 = src[stride];

Legend:
Removed from v.1.4.2.2  
changed lines
  Added in v.1.4.2.6

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4