Changeset 388 for python/vendor/current/Modules/yuvconvert.c
- Timestamp:
- Mar 19, 2014, 11:11:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/vendor/current/Modules/yuvconvert.c
r2 r388 5 5 yuv_sv411_to_cl422dc(int invert, void *data, void *yuv, int width, int height) 6 6 { 7 8 9 10 int i, j;/* counters */7 struct yuv411 *in = data; 8 struct yuv422 *out_even = yuv; 9 struct yuv422 *out_odd = out_even + width / 2; 10 int i, j; /* counters */ 11 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 12 for (i = height / 2; i--; ) { 13 for (j = width / 4; j--; ) { 14 YUV422_Y0(*out_even) = YUV411_Y00(*in); 15 YUV422_U0(*out_even) = YUV411_U00(*in); 16 YUV422_V0(*out_even) = YUV411_V00(*in); 17 YUV422_Y1(*out_even) = YUV411_Y01(*in); 18 out_even++; 19 YUV422_Y0(*out_even) = YUV411_Y02(*in); 20 YUV422_U0(*out_even) = YUV411_U02(*in); 21 YUV422_V0(*out_even) = YUV411_V02(*in); 22 YUV422_Y1(*out_even) = YUV411_Y03(*in); 23 out_even++; 24 YUV422_Y0(*out_odd) = YUV411_Y10(*in); 25 YUV422_U0(*out_odd) = YUV411_U10(*in); 26 YUV422_V0(*out_odd) = YUV411_V10(*in); 27 YUV422_Y1(*out_odd) = YUV411_Y11(*in); 28 out_odd++; 29 YUV422_Y0(*out_odd) = YUV411_Y12(*in); 30 YUV422_U0(*out_odd) = YUV411_U12(*in); 31 YUV422_V0(*out_odd) = YUV411_V12(*in); 32 YUV422_Y1(*out_odd) = YUV411_Y13(*in); 33 out_odd++; 34 in++; 35 } 36 out_even += width / 2; 37 out_odd += width / 2; 38 } 39 39 } 40 40 41 41 void 42 42 yuv_sv411_to_cl422dc_quartersize(int invert, void *data, void *yuv, 43 43 int width, int height) 44 44 { 45 int w4 = width / 4;/* quarter of width is used often */46 47 48 49 50 int i, j;/* counters */51 int u, v;/* U and V values */45 int w4 = width / 4; /* quarter of width is used often */ 46 struct yuv411 *in_even = data; 47 struct yuv411 *in_odd = in_even + w4; 48 struct yuv422 *out_even = yuv; 49 struct yuv422 *out_odd = out_even + w4; 50 int i, j; /* counters */ 51 int u, v; /* U and V values */ 52 52 53 54 55 56 53 for (i = height / 4; i--; ) { 54 for (j = w4; j--; ) { 55 u = YUV411_U00(*in_even); 56 v = YUV411_V00(*in_even); 57 57 58 59 60 61 58 YUV422_Y0(*out_even) = YUV411_Y00(*in_even); 59 YUV422_U0(*out_even) = u; 60 YUV422_V0(*out_even) = v; 61 YUV422_Y1(*out_even) = YUV411_Y02(*in_even); 62 62 63 64 65 66 63 YUV422_Y0(*out_odd) = YUV411_Y10(*in_odd); 64 YUV422_U0(*out_odd) = u; 65 YUV422_V0(*out_odd) = v; 66 YUV422_Y1(*out_odd) = YUV411_Y12(*in_odd); 67 67 68 69 70 71 72 73 74 75 76 77 68 in_even++; 69 in_odd++; 70 out_even++; 71 out_odd++; 72 } 73 in_even += w4; 74 in_odd += w4; 75 out_even += w4; 76 out_odd += w4; 77 } 78 78 } 79 79 80 80 void 81 81 yuv_sv411_to_cl422dc_sixteenthsize(int invert, void *data, void *yuv, 82 82 int width, int height) 83 83 { 84 85 int w8 = width / 8;/* and so is one eighth */86 87 88 89 90 int i, j;/* counters */91 int u, v;/* U and V values */84 int w4_3 = 3 * width / 4; /* three quarters of width is used often */ 85 int w8 = width / 8; /* and so is one eighth */ 86 struct yuv411 *in_even = data; 87 struct yuv411 *in_odd = in_even + width / 2; 88 struct yuv422 *out_even = yuv; 89 struct yuv422 *out_odd = out_even + w8; 90 int i, j; /* counters */ 91 int u, v; /* U and V values */ 92 92 93 94 95 96 93 for (i = height / 8; i--; ) { 94 for (j = w8; j--; ) { 95 u = YUV411_U00(in_even[0]); 96 v = YUV411_V00(in_even[0]); 97 97 98 99 100 101 98 YUV422_Y0(*out_even) = YUV411_Y00(in_even[0]); 99 YUV422_U0(*out_even) = u; 100 YUV422_V0(*out_even) = v; 101 YUV422_Y1(*out_even) = YUV411_Y00(in_even[1]); 102 102 103 104 105 106 103 YUV422_Y0(*out_odd) = YUV411_Y00(in_odd[0]); 104 YUV422_U0(*out_odd) = u; 105 YUV422_V0(*out_odd) = v; 106 YUV422_Y1(*out_odd) = YUV411_Y00(in_even[1]); 107 107 108 109 110 111 112 113 114 115 116 117 108 in_even += 2; 109 in_odd += 2; 110 out_even++; 111 out_odd++; 112 } 113 in_even += w4_3; 114 in_odd += w4_3; 115 out_even += w8; 116 out_odd += w8; 117 } 118 118 }
Note:
See TracChangeset
for help on using the changeset viewer.