comparison postproc/yuv2rgb.c @ 6492:e7635c03910f

sync with mplayer xp - partial yvu9 support (copy only) - rgb 15/16 -> 24/32 converters - int->unsigned changes
author arpi
date Sat, 22 Jun 2002 08:49:45 +0000
parents 766505ef1c33
children aad616b63bed
comparison
equal deleted inserted replaced
6491:920796b6c7b1 6492:e7635c03910f
154 {104597, 132201, 25675, 53279}, /* ITU-R Rec. 624-4 System B, G */ 154 {104597, 132201, 25675, 53279}, /* ITU-R Rec. 624-4 System B, G */
155 {104597, 132201, 25675, 53279}, /* SMPTE 170M */ 155 {104597, 132201, 25675, 53279}, /* SMPTE 170M */
156 {117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */ 156 {117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */
157 }; 157 };
158 158
159 static void yuv2rgb_c_init (int bpp, int mode); 159 static void yuv2rgb_c_init (unsigned bpp, int mode);
160 160
161 yuv2rgb_fun yuv2rgb; 161 yuv2rgb_fun yuv2rgb;
162 162
163 static void (* yuv2rgb_c_internal) (uint8_t *, uint8_t *, 163 static void (* yuv2rgb_c_internal) (uint8_t *, uint8_t *,
164 uint8_t *, uint8_t *, 164 uint8_t *, uint8_t *,
165 void *, void *, int, int); 165 void *, void *, int, int);
166 166
167 static void yuv2rgb_c (void * dst, uint8_t * py, 167 static void yuv2rgb_c (void * dst, uint8_t * py,
168 uint8_t * pu, uint8_t * pv, 168 uint8_t * pu, uint8_t * pv,
169 int h_size, int v_size, 169 unsigned h_size, unsigned v_size,
170 int rgb_stride, int y_stride, int uv_stride) 170 unsigned rgb_stride, unsigned y_stride, unsigned uv_stride)
171 { 171 {
172 v_size >>= 1; 172 v_size >>= 1;
173 173
174 while (v_size--) { 174 while (v_size--) {
175 yuv2rgb_c_internal (py, py + y_stride, pu, pv, dst, dst + rgb_stride, 175 yuv2rgb_c_internal (py, py + y_stride, pu, pv, dst, dst + rgb_stride,
176 h_size, v_size<<1); 176 h_size, v_size<<1);
177 177
178 py += 2 * y_stride; 178 py += 2 * y_stride;
180 pv += uv_stride; 180 pv += uv_stride;
181 dst += 2 * rgb_stride; 181 dst += 2 * rgb_stride;
182 } 182 }
183 } 183 }
184 184
185 void yuv2rgb_init (int bpp, int mode) 185 void yuv2rgb_init (unsigned bpp, int mode)
186 { 186 {
187 yuv2rgb = NULL; 187 yuv2rgb = NULL;
188 #ifdef CAN_COMPILE_X86_ASM 188 #ifdef CAN_COMPILE_X86_ASM
189 if(gCpuCaps.hasMMX2) 189 if(gCpuCaps.hasMMX2)
190 { 190 {
674 return (dividend + (divisor>>1)) / divisor; 674 return (dividend + (divisor>>1)) / divisor;
675 else 675 else
676 return -((-dividend + (divisor>>1)) / divisor); 676 return -((-dividend + (divisor>>1)) / divisor);
677 } 677 }
678 678
679 static void yuv2rgb_c_init (int bpp, int mode) 679 static void yuv2rgb_c_init (unsigned bpp, int mode)
680 { 680 {
681 int i; 681 int i;
682 uint8_t table_Y[1024]; 682 uint8_t table_Y[1024];
683 uint32_t *table_32 = 0; 683 uint32_t *table_32 = 0;
684 uint16_t *table_16 = 0; 684 uint16_t *table_16 = 0;