2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
12 #include "vpx_scale/vpxscale.h"
13 #include "vpx_mem/vpx_mem.h"
14 /****************************************************************************
16 ****************************************************************************/
18 /****************************************************************************
20 * ROUTINE : vp8cx_horizontal_line_4_5_scale_c
22 * INPUTS : const unsigned char *source : Pointer to source data.
23 * unsigned int source_width : Stride of source.
24 * unsigned char *dest : Pointer to destination data.
25 * unsigned int dest_width : Stride of destination (NOT USED).
31 * FUNCTION : Copies horizontal line of pixels from source to
32 * destination scaling up by 4 to 5.
34 * SPECIAL NOTES : None.
36 ****************************************************************************/
37 void vp8cx_horizontal_line_4_5_scale_c
39 const unsigned char *source
,
40 unsigned int source_width
,
42 unsigned int dest_width
47 unsigned char *des
= dest
;
48 const unsigned char *src
= source
;
52 for (i
= 0; i
< source_width
- 4; i
+= 4)
56 des
[0] = (unsigned char) a
;
57 des
[1] = (unsigned char)((a
* 51 + 205 * b
+ 128) >> 8);
60 des
[2] = (unsigned char)((b
* 102 + c
+ 128) >> 8);
61 des
[3] = (unsigned char)((c
+ 102 * a
+ 128) >> 8);
63 des
[4] = (unsigned char)((a
* 205 + 51 * b
+ 128) >> 8);
71 des
[0] = (unsigned char)(a
);
72 des
[1] = (unsigned char)((a
* 51 + 205 * b
+ 128) >> 8);
75 des
[2] = (unsigned char)((b
* 102 + c
+ 128) >> 8);
76 des
[3] = (unsigned char)((c
+ 102 * a
+ 128) >> 8);
77 des
[4] = (unsigned char)(a
);
81 /****************************************************************************
83 * ROUTINE : vp8cx_vertical_band_4_5_scale_c
85 * INPUTS : unsigned char *dest : Pointer to destination data.
86 * unsigned int dest_pitch : Stride of destination data.
87 * unsigned int dest_width : Width of destination data.
93 * FUNCTION : Scales vertical band of pixels by scale 4 to 5. The
94 * height of the band scaled is 4-pixels.
96 * SPECIAL NOTES : The routine uses the first line of the band below
99 ****************************************************************************/
100 void vp8cx_vertical_band_4_5_scale_c(unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
103 unsigned int a
, b
, c
, d
;
104 unsigned char *des
= dest
;
106 for (i
= 0; i
< dest_width
; i
++)
109 b
= des
[dest_pitch
];
111 des
[dest_pitch
] = (unsigned char)((a
* 51 + 205 * b
+ 128) >> 8);
113 c
= des
[dest_pitch
*2] * 154;
114 d
= des
[dest_pitch
*3];
116 des
[dest_pitch
*2] = (unsigned char)((b
* 102 + c
+ 128) >> 8);
117 des
[dest_pitch
*3] = (unsigned char)((c
+ 102 * d
+ 128) >> 8);
119 /* First line in next band */
120 a
= des
[dest_pitch
* 5];
121 des
[dest_pitch
* 4] = (unsigned char)((d
* 205 + 51 * a
+ 128) >> 8);
127 /****************************************************************************
129 * ROUTINE : vp8cx_last_vertical_band_4_5_scale_c
131 * INPUTS : unsigned char *dest : Pointer to destination data.
132 * unsigned int dest_pitch : Stride of destination data.
133 * unsigned int dest_width : Width of destination data.
139 * FUNCTION : Scales last vertical band of pixels by scale 4 to 5. The
140 * height of the band scaled is 4-pixels.
142 * SPECIAL NOTES : The routine does not have available the first line of
143 * the band below the current band, since this is the
146 ****************************************************************************/
147 void vp8cx_last_vertical_band_4_5_scale_c(unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
150 unsigned int a
, b
, c
, d
;
151 unsigned char *des
= dest
;
153 for (i
= 0; i
< dest_width
; ++i
)
158 des
[dest_pitch
] = (unsigned char)((a
* 51 + 205 * b
+ 128) >> 8);
160 c
= des
[dest_pitch
*2] * 154;
161 d
= des
[dest_pitch
*3];
163 des
[dest_pitch
*2] = (unsigned char)((b
* 102 + c
+ 128) >> 8);
164 des
[dest_pitch
*3] = (unsigned char)((c
+ 102 * d
+ 128) >> 8);
166 /* No other line for interplation of this line, so .. */
167 des
[dest_pitch
*4] = (unsigned char) d
;
173 /****************************************************************************
175 * ROUTINE : vp8cx_horizontal_line_2_3_scale_c
177 * INPUTS : const unsigned char *source : Pointer to source data.
178 * unsigned int source_width : Stride of source.
179 * unsigned char *dest : Pointer to destination data.
180 * unsigned int dest_width : Stride of destination (NOT USED).
186 * FUNCTION : Copies horizontal line of pixels from source to
187 * destination scaling up by 2 to 3.
189 * SPECIAL NOTES : None.
192 ****************************************************************************/
193 void vp8cx_horizontal_line_2_3_scale_c
195 const unsigned char *source
,
196 unsigned int source_width
,
198 unsigned int dest_width
202 unsigned int a
, b
, c
;
203 unsigned char *des
= dest
;
204 const unsigned char *src
= source
;
208 for (i
= 0; i
< source_width
- 2; i
+= 2)
214 des
[0] = (unsigned char)(a
);
215 des
[1] = (unsigned char)((a
* 85 + 171 * b
+ 128) >> 8);
216 des
[2] = (unsigned char)((b
* 171 + 85 * c
+ 128) >> 8);
224 des
[0] = (unsigned char)(a
);
225 des
[1] = (unsigned char)((a
* 85 + 171 * b
+ 128) >> 8);
226 des
[2] = (unsigned char)(b
);
230 /****************************************************************************
232 * ROUTINE : vp8cx_vertical_band_2_3_scale_c
234 * INPUTS : unsigned char *dest : Pointer to destination data.
235 * unsigned int dest_pitch : Stride of destination data.
236 * unsigned int dest_width : Width of destination data.
242 * FUNCTION : Scales vertical band of pixels by scale 2 to 3. The
243 * height of the band scaled is 2-pixels.
245 * SPECIAL NOTES : The routine uses the first line of the band below
248 ****************************************************************************/
249 void vp8cx_vertical_band_2_3_scale_c(unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
252 unsigned int a
, b
, c
;
253 unsigned char *des
= dest
;
255 for (i
= 0; i
< dest_width
; i
++)
258 b
= des
[dest_pitch
];
259 c
= des
[dest_pitch
*3];
260 des
[dest_pitch
] = (unsigned char)((a
* 85 + 171 * b
+ 128) >> 8);
261 des
[dest_pitch
*2] = (unsigned char)((b
* 171 + 85 * c
+ 128) >> 8);
267 /****************************************************************************
269 * ROUTINE : vp8cx_last_vertical_band_2_3_scale_c
271 * INPUTS : unsigned char *dest : Pointer to destination data.
272 * unsigned int dest_pitch : Stride of destination data.
273 * unsigned int dest_width : Width of destination data.
279 * FUNCTION : Scales last vertical band of pixels by scale 2 to 3. The
280 * height of the band scaled is 2-pixels.
282 * SPECIAL NOTES : The routine does not have available the first line of
283 * the band below the current band, since this is the
286 ****************************************************************************/
287 void vp8cx_last_vertical_band_2_3_scale_c(unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
291 unsigned char *des
= dest
;
293 for (i
= 0; i
< dest_width
; ++i
)
296 b
= des
[dest_pitch
];
298 des
[dest_pitch
] = (unsigned char)((a
* 85 + 171 * b
+ 128) >> 8);
299 des
[dest_pitch
*2] = (unsigned char)(b
);
304 /****************************************************************************
306 * ROUTINE : vp8cx_horizontal_line_3_5_scale_c
308 * INPUTS : const unsigned char *source : Pointer to source data.
309 * unsigned int source_width : Stride of source.
310 * unsigned char *dest : Pointer to destination data.
311 * unsigned int dest_width : Stride of destination (NOT USED).
317 * FUNCTION : Copies horizontal line of pixels from source to
318 * destination scaling up by 3 to 5.
320 * SPECIAL NOTES : None.
323 ****************************************************************************/
324 void vp8cx_horizontal_line_3_5_scale_c
326 const unsigned char *source
,
327 unsigned int source_width
,
329 unsigned int dest_width
333 unsigned int a
, b
, c
;
334 unsigned char *des
= dest
;
335 const unsigned char *src
= source
;
339 for (i
= 0; i
< source_width
- 3; i
+= 3)
343 des
[0] = (unsigned char)(a
);
344 des
[1] = (unsigned char)((a
* 102 + 154 * b
+ 128) >> 8);
347 des
[2] = (unsigned char)((b
* 205 + c
* 51 + 128) >> 8);
348 des
[3] = (unsigned char)((b
* 51 + c
* 205 + 128) >> 8);
351 des
[4] = (unsigned char)((c
* 154 + a
* 102 + 128) >> 8);
359 des
[0] = (unsigned char)(a
);
361 des
[1] = (unsigned char)((a
* 102 + 154 * b
+ 128) >> 8);
363 des
[2] = (unsigned char)((b
* 205 + c
* 51 + 128) >> 8);
364 des
[3] = (unsigned char)((b
* 51 + c
* 205 + 128) >> 8);
366 des
[4] = (unsigned char)(c
);
369 /****************************************************************************
371 * ROUTINE : vp8cx_vertical_band_3_5_scale_c
373 * INPUTS : unsigned char *dest : Pointer to destination data.
374 * unsigned int dest_pitch : Stride of destination data.
375 * unsigned int dest_width : Width of destination data.
381 * FUNCTION : Scales vertical band of pixels by scale 3 to 5. The
382 * height of the band scaled is 3-pixels.
384 * SPECIAL NOTES : The routine uses the first line of the band below
387 ****************************************************************************/
388 void vp8cx_vertical_band_3_5_scale_c(unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
391 unsigned int a
, b
, c
;
392 unsigned char *des
= dest
;
394 for (i
= 0; i
< dest_width
; i
++)
397 b
= des
[dest_pitch
];
398 des
[dest_pitch
] = (unsigned char)((a
* 102 + 154 * b
+ 128) >> 8);
400 c
= des
[dest_pitch
*2];
401 des
[dest_pitch
*2] = (unsigned char)((b
* 205 + c
* 51 + 128) >> 8);
402 des
[dest_pitch
*3] = (unsigned char)((b
* 51 + c
* 205 + 128) >> 8);
404 /* First line in next band... */
405 a
= des
[dest_pitch
* 5];
406 des
[dest_pitch
* 4] = (unsigned char)((c
* 154 + a
* 102 + 128) >> 8);
412 /****************************************************************************
414 * ROUTINE : vp8cx_last_vertical_band_3_5_scale_c
416 * INPUTS : unsigned char *dest : Pointer to destination data.
417 * unsigned int dest_pitch : Stride of destination data.
418 * unsigned int dest_width : Width of destination data.
424 * FUNCTION : Scales last vertical band of pixels by scale 3 to 5. The
425 * height of the band scaled is 3-pixels.
427 * SPECIAL NOTES : The routine does not have available the first line of
428 * the band below the current band, since this is the
431 ****************************************************************************/
432 void vp8cx_last_vertical_band_3_5_scale_c(unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
435 unsigned int a
, b
, c
;
436 unsigned char *des
= dest
;
438 for (i
= 0; i
< dest_width
; ++i
)
441 b
= des
[dest_pitch
];
443 des
[ dest_pitch
] = (unsigned char)((a
* 102 + 154 * b
+ 128) >> 8);
445 c
= des
[dest_pitch
*2];
446 des
[dest_pitch
*2] = (unsigned char)((b
* 205 + c
* 51 + 128) >> 8);
447 des
[dest_pitch
*3] = (unsigned char)((b
* 51 + c
* 205 + 128) >> 8);
449 /* No other line for interplation of this line, so .. */
450 des
[ dest_pitch
* 4 ] = (unsigned char)(c
) ;
456 /****************************************************************************
458 * ROUTINE : vp8cx_horizontal_line_3_4_scale_c
460 * INPUTS : const unsigned char *source : Pointer to source data.
461 * unsigned int source_width : Stride of source.
462 * unsigned char *dest : Pointer to destination data.
463 * unsigned int dest_width : Stride of destination (NOT USED).
469 * FUNCTION : Copies horizontal line of pixels from source to
470 * destination scaling up by 3 to 4.
472 * SPECIAL NOTES : None.
475 ****************************************************************************/
476 void vp8cx_horizontal_line_3_4_scale_c
478 const unsigned char *source
,
479 unsigned int source_width
,
481 unsigned int dest_width
485 unsigned int a
, b
, c
;
486 unsigned char *des
= dest
;
487 const unsigned char *src
= source
;
491 for (i
= 0; i
< source_width
- 3; i
+= 3)
495 des
[0] = (unsigned char)(a
);
496 des
[1] = (unsigned char)((a
* 64 + b
* 192 + 128) >> 8);
499 des
[2] = (unsigned char)((b
+ c
+ 1) >> 1);
502 des
[3] = (unsigned char)((c
* 192 + a
* 64 + 128) >> 8);
510 des
[0] = (unsigned char)(a
);
511 des
[1] = (unsigned char)((a
* 64 + b
* 192 + 128) >> 8);
514 des
[2] = (unsigned char)((b
+ c
+ 1) >> 1);
515 des
[3] = (unsigned char)(c
);
518 /****************************************************************************
520 * ROUTINE : vp8cx_vertical_band_3_4_scale_c
522 * INPUTS : unsigned char *dest : Pointer to destination data.
523 * unsigned int dest_pitch : Stride of destination data.
524 * unsigned int dest_width : Width of destination data.
530 * FUNCTION : Scales vertical band of pixels by scale 3 to 4. The
531 * height of the band scaled is 3-pixels.
533 * SPECIAL NOTES : The routine uses the first line of the band below
536 ****************************************************************************/
537 void vp8cx_vertical_band_3_4_scale_c(unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
540 unsigned int a
, b
, c
;
541 unsigned char *des
= dest
;
543 for (i
= 0; i
< dest_width
; i
++)
546 b
= des
[dest_pitch
];
547 des
[dest_pitch
] = (unsigned char)((a
* 64 + b
* 192 + 128) >> 8);
549 c
= des
[dest_pitch
*2];
550 des
[dest_pitch
*2] = (unsigned char)((b
+ c
+ 1) >> 1);
552 /* First line in next band... */
553 a
= des
[dest_pitch
*4];
554 des
[dest_pitch
*3] = (unsigned char)((c
* 192 + a
* 64 + 128) >> 8);
560 /****************************************************************************
562 * ROUTINE : vp8cx_last_vertical_band_3_4_scale_c
564 * INPUTS : unsigned char *dest : Pointer to destination data.
565 * unsigned int dest_pitch : Stride of destination data.
566 * unsigned int dest_width : Width of destination data.
572 * FUNCTION : Scales last vertical band of pixels by scale 3 to 4. The
573 * height of the band scaled is 3-pixels.
575 * SPECIAL NOTES : The routine does not have available the first line of
576 * the band below the current band, since this is the
579 ****************************************************************************/
580 void vp8cx_last_vertical_band_3_4_scale_c(unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
583 unsigned int a
, b
, c
;
584 unsigned char *des
= dest
;
586 for (i
= 0; i
< dest_width
; ++i
)
589 b
= des
[dest_pitch
];
591 des
[dest_pitch
] = (unsigned char)((a
* 64 + b
* 192 + 128) >> 8);
593 c
= des
[dest_pitch
*2];
594 des
[dest_pitch
*2] = (unsigned char)((b
+ c
+ 1) >> 1);
596 /* No other line for interplation of this line, so .. */
597 des
[dest_pitch
*3] = (unsigned char)(c
);
603 /****************************************************************************
605 * ROUTINE : vp8cx_horizontal_line_1_2_scale_c
607 * INPUTS : const unsigned char *source : Pointer to source data.
608 * unsigned int source_width : Stride of source.
609 * unsigned char *dest : Pointer to destination data.
610 * unsigned int dest_width : Stride of destination (NOT USED).
616 * FUNCTION : Copies horizontal line of pixels from source to
617 * destination scaling up by 1 to 2.
619 * SPECIAL NOTES : None.
621 ****************************************************************************/
622 void vp8cx_horizontal_line_1_2_scale_c
624 const unsigned char *source
,
625 unsigned int source_width
,
627 unsigned int dest_width
632 unsigned char *des
= dest
;
633 const unsigned char *src
= source
;
637 for (i
= 0; i
< source_width
- 1; i
+= 1)
641 des
[0] = (unsigned char)(a
);
642 des
[1] = (unsigned char)((a
+ b
+ 1) >> 1);
648 des
[0] = (unsigned char)(a
);
649 des
[1] = (unsigned char)(a
);
652 /****************************************************************************
654 * ROUTINE : vp8cx_vertical_band_1_2_scale_c
656 * INPUTS : unsigned char *dest : Pointer to destination data.
657 * unsigned int dest_pitch : Stride of destination data.
658 * unsigned int dest_width : Width of destination data.
664 * FUNCTION : Scales vertical band of pixels by scale 1 to 2. The
665 * height of the band scaled is 1-pixel.
667 * SPECIAL NOTES : The routine uses the first line of the band below
670 ****************************************************************************/
671 void vp8cx_vertical_band_1_2_scale_c(unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
675 unsigned char *des
= dest
;
677 for (i
= 0; i
< dest_width
; i
++)
680 b
= des
[dest_pitch
* 2];
682 des
[dest_pitch
] = (unsigned char)((a
+ b
+ 1) >> 1);
688 /****************************************************************************
690 * ROUTINE : vp8cx_last_vertical_band_1_2_scale_c
692 * INPUTS : unsigned char *dest : Pointer to destination data.
693 * unsigned int dest_pitch : Stride of destination data.
694 * unsigned int dest_width : Width of destination data.
700 * FUNCTION : Scales last vertical band of pixels by scale 1 to 2. The
701 * height of the band scaled is 1-pixel.
703 * SPECIAL NOTES : The routine does not have available the first line of
704 * the band below the current band, since this is the
707 ****************************************************************************/
708 void vp8cx_last_vertical_band_1_2_scale_c(unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
711 unsigned char *des
= dest
;
713 for (i
= 0; i
< dest_width
; ++i
)
715 des
[dest_pitch
] = des
[0];
724 /****************************************************************************
726 * ROUTINE : vp8cx_horizontal_line_4_5_scale_c
728 * INPUTS : const unsigned char *source : Pointer to source data.
729 * unsigned int source_width : Stride of source.
730 * unsigned char *dest : Pointer to destination data.
731 * unsigned int dest_width : Stride of destination (NOT USED).
737 * FUNCTION : Copies horizontal line of pixels from source to
738 * destination scaling up by 4 to 5.
740 * SPECIAL NOTES : None.
742 ****************************************************************************/
743 void vp8cx_horizontal_line_5_4_scale_c
745 const unsigned char *source
,
746 unsigned int source_width
,
748 unsigned int dest_width
752 unsigned int a
, b
, c
, d
, e
;
753 unsigned char *des
= dest
;
754 const unsigned char *src
= source
;
758 for (i
= 0; i
< source_width
; i
+= 5)
766 des
[0] = (unsigned char) a
;
767 des
[1] = (unsigned char)((b
* 192 + c
* 64 + 128) >> 8);
768 des
[2] = (unsigned char)((c
* 128 + d
* 128 + 128) >> 8);
769 des
[3] = (unsigned char)((d
* 64 + e
* 192 + 128) >> 8);
779 void vp8cx_vertical_band_5_4_scale_c(unsigned char *source
, unsigned int src_pitch
, unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
782 unsigned int a
, b
, c
, d
, e
;
783 unsigned char *des
= dest
;
784 unsigned char *src
= source
;
786 for (i
= 0; i
< dest_width
; i
++)
789 a
= src
[0 * src_pitch
];
790 b
= src
[1 * src_pitch
];
791 c
= src
[2 * src_pitch
];
792 d
= src
[3 * src_pitch
];
793 e
= src
[4 * src_pitch
];
795 des
[0 * dest_pitch
] = (unsigned char) a
;
796 des
[1 * dest_pitch
] = (unsigned char)((b
* 192 + c
* 64 + 128) >> 8);
797 des
[2 * dest_pitch
] = (unsigned char)((c
* 128 + d
* 128 + 128) >> 8);
798 des
[3 * dest_pitch
] = (unsigned char)((d
* 64 + e
* 192 + 128) >> 8);
807 /*7***************************************************************************
809 * ROUTINE : vp8cx_horizontal_line_3_5_scale_c
811 * INPUTS : const unsigned char *source : Pointer to source data.
812 * unsigned int source_width : Stride of source.
813 * unsigned char *dest : Pointer to destination data.
814 * unsigned int dest_width : Stride of destination (NOT USED).
820 * FUNCTION : Copies horizontal line of pixels from source to
821 * destination scaling up by 3 to 5.
823 * SPECIAL NOTES : None.
826 ****************************************************************************/
827 void vp8cx_horizontal_line_5_3_scale_c
829 const unsigned char *source
,
830 unsigned int source_width
,
832 unsigned int dest_width
836 unsigned int a
, b
, c
, d
, e
;
837 unsigned char *des
= dest
;
838 const unsigned char *src
= source
;
842 for (i
= 0; i
< source_width
; i
+= 5)
850 des
[0] = (unsigned char) a
;
851 des
[1] = (unsigned char)((b
* 85 + c
* 171 + 128) >> 8);
852 des
[2] = (unsigned char)((d
* 171 + e
* 85 + 128) >> 8);
860 void vp8cx_vertical_band_5_3_scale_c(unsigned char *source
, unsigned int src_pitch
, unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
863 unsigned int a
, b
, c
, d
, e
;
864 unsigned char *des
= dest
;
865 unsigned char *src
= source
;
867 for (i
= 0; i
< dest_width
; i
++)
870 a
= src
[0 * src_pitch
];
871 b
= src
[1 * src_pitch
];
872 c
= src
[2 * src_pitch
];
873 d
= src
[3 * src_pitch
];
874 e
= src
[4 * src_pitch
];
876 des
[0 * dest_pitch
] = (unsigned char) a
;
877 des
[1 * dest_pitch
] = (unsigned char)((b
* 85 + c
* 171 + 128) >> 8);
878 des
[2 * dest_pitch
] = (unsigned char)((d
* 171 + e
* 85 + 128) >> 8);
886 /****************************************************************************
888 * ROUTINE : vp8cx_horizontal_line_1_2_scale_c
890 * INPUTS : const unsigned char *source : Pointer to source data.
891 * unsigned int source_width : Stride of source.
892 * unsigned char *dest : Pointer to destination data.
893 * unsigned int dest_width : Stride of destination (NOT USED).
899 * FUNCTION : Copies horizontal line of pixels from source to
900 * destination scaling up by 1 to 2.
902 * SPECIAL NOTES : None.
904 ****************************************************************************/
905 void vp8cx_horizontal_line_2_1_scale_c
907 const unsigned char *source
,
908 unsigned int source_width
,
910 unsigned int dest_width
915 unsigned char *des
= dest
;
916 const unsigned char *src
= source
;
920 for (i
= 0; i
< source_width
; i
+= 2)
923 des
[0] = (unsigned char)(a
);
931 void vp8cx_vertical_band_2_1_scale_c(unsigned char *source
, unsigned int src_pitch
, unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
935 vpx_memcpy(dest
, source
, dest_width
);
938 void vp8cx_vertical_band_2_1_scale_i_c(unsigned char *source
, unsigned int src_pitch
, unsigned char *dest
, unsigned int dest_pitch
, unsigned int dest_width
)
942 int width
= dest_width
;
946 for (i
= 0; i
< width
; i
++)
949 temp
+= source
[i
-(int)src_pitch
] * 3;
950 temp
+= source
[i
] * 10;
951 temp
+= source
[i
+src_pitch
] * 3;
953 dest
[i
] = (unsigned char)(temp
);