PageRenderTime 566ms CodeModel.GetById 151ms app.highlight 19ms RepoModel.GetById 1ms app.codeStats 18ms

/Avc/yuv2rgb16tab.cpp

http://github.com/mbebenita/Broadway
C++ | 789 lines | 772 code | 3 blank | 14 comment | 0 complexity | ea13a7c42a9e241726147818ef651885 MD5 | raw file
  1/* YUV-> RGB conversion code.
  2 *
  3 * Copyright (C) 2011 Robin Watts (robin@wss.co.uk) for Pinknoise
  4 * Productions Ltd.
  5 *
  6 * Licensed under the BSD license. See 'COPYING' for details of
  7 * (non-)warranty.
  8 *
  9 */
 10
 11/* For BREW or Symbian you might need to make this static const rather than
 12 * just const, and introduce a function to get the address. */
 13
 14#include "yuv2rgb.h"
 15
 16const uint32_t yuv2rgb565_table[256*3] =
 17{
 18	/* y_table */
 19        0x7FFFFFEDU,
 20        0x7FFFFFEFU,
 21        0x7FFFFFF0U,
 22        0x7FFFFFF1U,
 23        0x7FFFFFF2U,
 24        0x7FFFFFF3U,
 25        0x7FFFFFF4U,
 26        0x7FFFFFF6U,
 27        0x7FFFFFF7U,
 28        0x7FFFFFF8U,
 29        0x7FFFFFF9U,
 30        0x7FFFFFFAU,
 31        0x7FFFFFFBU,
 32        0x7FFFFFFDU,
 33        0x7FFFFFFEU,
 34        0x7FFFFFFFU,
 35        0x80000000U,
 36        0x80400801U,
 37        0x80A01002U,
 38        0x80E01803U,
 39        0x81202805U,
 40        0x81803006U,
 41        0x81C03807U,
 42        0x82004008U,
 43        0x82604809U,
 44        0x82A0500AU,
 45        0x82E0600CU,
 46        0x8340680DU,
 47        0x8380700EU,
 48        0x83C0780FU,
 49        0x84208010U,
 50        0x84608811U,
 51        0x84A09813U,
 52        0x8500A014U,
 53        0x8540A815U,
 54        0x8580B016U,
 55        0x85E0B817U,
 56        0x8620C018U,
 57        0x8660D01AU,
 58        0x86C0D81BU,
 59        0x8700E01CU,
 60        0x8740E81DU,
 61        0x87A0F01EU,
 62        0x87E0F81FU,
 63        0x88210821U,
 64        0x88811022U,
 65        0x88C11823U,
 66        0x89012024U,
 67        0x89412825U,
 68        0x89A13026U,
 69        0x89E14028U,
 70        0x8A214829U,
 71        0x8A81502AU,
 72        0x8AC1582BU,
 73        0x8B01602CU,
 74        0x8B61682DU,
 75        0x8BA1782FU,
 76        0x8BE18030U,
 77        0x8C418831U,
 78        0x8C819032U,
 79        0x8CC19833U,
 80        0x8D21A034U,
 81        0x8D61B036U,
 82        0x8DA1B837U,
 83        0x8E01C038U,
 84        0x8E41C839U,
 85        0x8E81D03AU,
 86        0x8EE1D83BU,
 87        0x8F21E83DU,
 88        0x8F61F03EU,
 89        0x8FC1F83FU,
 90        0x90020040U,
 91        0x90420841U,
 92        0x90A21042U,
 93        0x90E22044U,
 94        0x91222845U,
 95        0x91823046U,
 96        0x91C23847U,
 97        0x92024048U,
 98        0x92624849U,
 99        0x92A2504AU,
100        0x92E2604CU,
101        0x9342684DU,
102        0x9382704EU,
103        0x93C2784FU,
104        0x94228050U,
105        0x94628851U,
106        0x94A29853U,
107        0x9502A054U,
108        0x9542A855U,
109        0x9582B056U,
110        0x95E2B857U,
111        0x9622C058U,
112        0x9662D05AU,
113        0x96C2D85BU,
114        0x9702E05CU,
115        0x9742E85DU,
116        0x97A2F05EU,
117        0x97E2F85FU,
118        0x98230861U,
119        0x98831062U,
120        0x98C31863U,
121        0x99032064U,
122        0x99632865U,
123        0x99A33066U,
124        0x99E34068U,
125        0x9A434869U,
126        0x9A83506AU,
127        0x9AC3586BU,
128        0x9B23606CU,
129        0x9B63686DU,
130        0x9BA3786FU,
131        0x9BE38070U,
132        0x9C438871U,
133        0x9C839072U,
134        0x9CC39873U,
135        0x9D23A074U,
136        0x9D63B076U,
137        0x9DA3B877U,
138        0x9E03C078U,
139        0x9E43C879U,
140        0x9E83D07AU,
141        0x9EE3D87BU,
142        0x9F23E87DU,
143        0x9F63F07EU,
144        0x9FC3F87FU,
145        0xA0040080U,
146        0xA0440881U,
147        0xA0A41082U,
148        0xA0E42084U,
149        0xA1242885U,
150        0xA1843086U,
151        0xA1C43887U,
152        0xA2044088U,
153        0xA2644889U,
154        0xA2A4588BU,
155        0xA2E4608CU,
156        0xA344688DU,
157        0xA384708EU,
158        0xA3C4788FU,
159        0xA4248090U,
160        0xA4649092U,
161        0xA4A49893U,
162        0xA504A094U,
163        0xA544A895U,
164        0xA584B096U,
165        0xA5E4B897U,
166        0xA624C098U,
167        0xA664D09AU,
168        0xA6C4D89BU,
169        0xA704E09CU,
170        0xA744E89DU,
171        0xA7A4F09EU,
172        0xA7E4F89FU,
173        0xA82508A1U,
174        0xA88510A2U,
175        0xA8C518A3U,
176        0xA90520A4U,
177        0xA96528A5U,
178        0xA9A530A6U,
179        0xA9E540A8U,
180        0xAA4548A9U,
181        0xAA8550AAU,
182        0xAAC558ABU,
183        0xAB2560ACU,
184        0xAB6568ADU,
185        0xABA578AFU,
186        0xAC0580B0U,
187        0xAC4588B1U,
188        0xAC8590B2U,
189        0xACE598B3U,
190        0xAD25A0B4U,
191        0xAD65B0B6U,
192        0xADA5B8B7U,
193        0xAE05C0B8U,
194        0xAE45C8B9U,
195        0xAE85D0BAU,
196        0xAEE5D8BBU,
197        0xAF25E8BDU,
198        0xAF65F0BEU,
199        0xAFC5F8BFU,
200        0xB00600C0U,
201        0xB04608C1U,
202        0xB0A610C2U,
203        0xB0E620C4U,
204        0xB12628C5U,
205        0xB18630C6U,
206        0xB1C638C7U,
207        0xB20640C8U,
208        0xB26648C9U,
209        0xB2A658CBU,
210        0xB2E660CCU,
211        0xB34668CDU,
212        0xB38670CEU,
213        0xB3C678CFU,
214        0xB42680D0U,
215        0xB46690D2U,
216        0xB4A698D3U,
217        0xB506A0D4U,
218        0xB546A8D5U,
219        0xB586B0D6U,
220        0xB5E6B8D7U,
221        0xB626C8D9U,
222        0xB666D0DAU,
223        0xB6C6D8DBU,
224        0xB706E0DCU,
225        0xB746E8DDU,
226        0xB7A6F0DEU,
227        0xB7E6F8DFU,
228        0xB82708E1U,
229        0xB88710E2U,
230        0xB8C718E3U,
231        0xB90720E4U,
232        0xB96728E5U,
233        0xB9A730E6U,
234        0xB9E740E8U,
235        0xBA4748E9U,
236        0xBA8750EAU,
237        0xBAC758EBU,
238        0xBB2760ECU,
239        0xBB6768EDU,
240        0xBBA778EFU,
241        0xBC0780F0U,
242        0xBC4788F1U,
243        0xBC8790F2U,
244        0xBCE798F3U,
245        0xBD27A0F4U,
246        0xBD67B0F6U,
247        0xBDC7B8F7U,
248        0xBE07C0F8U,
249        0xBE47C8F9U,
250        0xBEA7D0FAU,
251        0xBEE7D8FBU,
252        0xBF27E8FDU,
253        0xBF87F0FEU,
254        0xBFC7F8FFU,
255        0xC0080100U,
256        0xC0480901U,
257        0xC0A81102U,
258        0xC0E82104U,
259        0xC0E82104U,
260        0xC0E82104U,
261        0xC0E82104U,
262        0xC0E82104U,
263        0xC0E82104U,
264        0xC0E82104U,
265        0xC0E82104U,
266        0xC0E82104U,
267        0xC0E82104U,
268        0xC0E82104U,
269        0xC0E82104U,
270        0xC0E82104U,
271        0xC0E82104U,
272        0xC0E82104U,
273        0xC0E82104U,
274        0xC0E82104U,
275	/* u_table */
276        0x0C400103U,
277        0x0C200105U,
278        0x0C200107U,
279        0x0C000109U,
280        0x0BE0010BU,
281        0x0BC0010DU,
282        0x0BA0010FU,
283        0x0BA00111U,
284        0x0B800113U,
285        0x0B600115U,
286        0x0B400117U,
287        0x0B400119U,
288        0x0B20011BU,
289        0x0B00011DU,
290        0x0AE0011FU,
291        0x0AE00121U,
292        0x0AC00123U,
293        0x0AA00125U,
294        0x0A800127U,
295        0x0A600129U,
296        0x0A60012BU,
297        0x0A40012DU,
298        0x0A20012FU,
299        0x0A000131U,
300        0x0A000132U,
301        0x09E00134U,
302        0x09C00136U,
303        0x09A00138U,
304        0x09A0013AU,
305        0x0980013CU,
306        0x0960013EU,
307        0x09400140U,
308        0x09400142U,
309        0x09200144U,
310        0x09000146U,
311        0x08E00148U,
312        0x08C0014AU,
313        0x08C0014CU,
314        0x08A0014EU,
315        0x08800150U,
316        0x08600152U,
317        0x08600154U,
318        0x08400156U,
319        0x08200158U,
320        0x0800015AU,
321        0x0800015CU,
322        0x07E0015EU,
323        0x07C00160U,
324        0x07A00162U,
325        0x07A00164U,
326        0x07800166U,
327        0x07600168U,
328        0x0740016AU,
329        0x0720016CU,
330        0x0720016EU,
331        0x07000170U,
332        0x06E00172U,
333        0x06C00174U,
334        0x06C00176U,
335        0x06A00178U,
336        0x0680017AU,
337        0x0660017CU,
338        0x0660017EU,
339        0x06400180U,
340        0x06200182U,
341        0x06000184U,
342        0x05E00185U,
343        0x05E00187U,
344        0x05C00189U,
345        0x05A0018BU,
346        0x0580018DU,
347        0x0580018FU,
348        0x05600191U,
349        0x05400193U,
350        0x05200195U,
351        0x05200197U,
352        0x05000199U,
353        0x04E0019BU,
354        0x04C0019DU,
355        0x04C0019FU,
356        0x04A001A1U,
357        0x048001A3U,
358        0x046001A5U,
359        0x044001A7U,
360        0x044001A9U,
361        0x042001ABU,
362        0x040001ADU,
363        0x03E001AFU,
364        0x03E001B1U,
365        0x03C001B3U,
366        0x03A001B5U,
367        0x038001B7U,
368        0x038001B9U,
369        0x036001BBU,
370        0x034001BDU,
371        0x032001BFU,
372        0x032001C1U,
373        0x030001C3U,
374        0x02E001C5U,
375        0x02C001C7U,
376        0x02A001C9U,
377        0x02A001CBU,
378        0x028001CDU,
379        0x026001CFU,
380        0x024001D1U,
381        0x024001D3U,
382        0x022001D5U,
383        0x020001D7U,
384        0x01E001D8U,
385        0x01E001DAU,
386        0x01C001DCU,
387        0x01A001DEU,
388        0x018001E0U,
389        0x016001E2U,
390        0x016001E4U,
391        0x014001E6U,
392        0x012001E8U,
393        0x010001EAU,
394        0x010001ECU,
395        0x00E001EEU,
396        0x00C001F0U,
397        0x00A001F2U,
398        0x00A001F4U,
399        0x008001F6U,
400        0x006001F8U,
401        0x004001FAU,
402        0x004001FCU,
403        0x002001FEU,
404        0x00000200U,
405        0xFFE00202U,
406        0xFFC00204U,
407        0xFFC00206U,
408        0xFFA00208U,
409        0xFF80020AU,
410        0xFF60020CU,
411        0xFF60020EU,
412        0xFF400210U,
413        0xFF200212U,
414        0xFF000214U,
415        0xFF000216U,
416        0xFEE00218U,
417        0xFEC0021AU,
418        0xFEA0021CU,
419        0xFEA0021EU,
420        0xFE800220U,
421        0xFE600222U,
422        0xFE400224U,
423        0xFE200226U,
424        0xFE200228U,
425        0xFE000229U,
426        0xFDE0022BU,
427        0xFDC0022DU,
428        0xFDC0022FU,
429        0xFDA00231U,
430        0xFD800233U,
431        0xFD600235U,
432        0xFD600237U,
433        0xFD400239U,
434        0xFD20023BU,
435        0xFD00023DU,
436        0xFCE0023FU,
437        0xFCE00241U,
438        0xFCC00243U,
439        0xFCA00245U,
440        0xFC800247U,
441        0xFC800249U,
442        0xFC60024BU,
443        0xFC40024DU,
444        0xFC20024FU,
445        0xFC200251U,
446        0xFC000253U,
447        0xFBE00255U,
448        0xFBC00257U,
449        0xFBC00259U,
450        0xFBA0025BU,
451        0xFB80025DU,
452        0xFB60025FU,
453        0xFB400261U,
454        0xFB400263U,
455        0xFB200265U,
456        0xFB000267U,
457        0xFAE00269U,
458        0xFAE0026BU,
459        0xFAC0026DU,
460        0xFAA0026FU,
461        0xFA800271U,
462        0xFA800273U,
463        0xFA600275U,
464        0xFA400277U,
465        0xFA200279U,
466        0xFA20027BU,
467        0xFA00027CU,
468        0xF9E0027EU,
469        0xF9C00280U,
470        0xF9A00282U,
471        0xF9A00284U,
472        0xF9800286U,
473        0xF9600288U,
474        0xF940028AU,
475        0xF940028CU,
476        0xF920028EU,
477        0xF9000290U,
478        0xF8E00292U,
479        0xF8E00294U,
480        0xF8C00296U,
481        0xF8A00298U,
482        0xF880029AU,
483        0xF860029CU,
484        0xF860029EU,
485        0xF84002A0U,
486        0xF82002A2U,
487        0xF80002A4U,
488        0xF80002A6U,
489        0xF7E002A8U,
490        0xF7C002AAU,
491        0xF7A002ACU,
492        0xF7A002AEU,
493        0xF78002B0U,
494        0xF76002B2U,
495        0xF74002B4U,
496        0xF74002B6U,
497        0xF72002B8U,
498        0xF70002BAU,
499        0xF6E002BCU,
500        0xF6C002BEU,
501        0xF6C002C0U,
502        0xF6A002C2U,
503        0xF68002C4U,
504        0xF66002C6U,
505        0xF66002C8U,
506        0xF64002CAU,
507        0xF62002CCU,
508        0xF60002CEU,
509        0xF60002CFU,
510        0xF5E002D1U,
511        0xF5C002D3U,
512        0xF5A002D5U,
513        0xF5A002D7U,
514        0xF58002D9U,
515        0xF56002DBU,
516        0xF54002DDU,
517        0xF52002DFU,
518        0xF52002E1U,
519        0xF50002E3U,
520        0xF4E002E5U,
521        0xF4C002E7U,
522        0xF4C002E9U,
523        0xF4A002EBU,
524        0xF48002EDU,
525        0xF46002EFU,
526        0xF46002F1U,
527        0xF44002F3U,
528        0xF42002F5U,
529        0xF40002F7U,
530        0xF3E002F9U,
531        0xF3E002FBU,
532	/* v_table */
533        0x1A09A000U,
534        0x19E9A800U,
535        0x19A9B800U,
536        0x1969C800U,
537        0x1949D000U,
538        0x1909E000U,
539        0x18C9E800U,
540        0x18A9F800U,
541        0x186A0000U,
542        0x182A1000U,
543        0x180A2000U,
544        0x17CA2800U,
545        0x17AA3800U,
546        0x176A4000U,
547        0x172A5000U,
548        0x170A6000U,
549        0x16CA6800U,
550        0x168A7800U,
551        0x166A8000U,
552        0x162A9000U,
553        0x160AA000U,
554        0x15CAA800U,
555        0x158AB800U,
556        0x156AC000U,
557        0x152AD000U,
558        0x14EAE000U,
559        0x14CAE800U,
560        0x148AF800U,
561        0x146B0000U,
562        0x142B1000U,
563        0x13EB2000U,
564        0x13CB2800U,
565        0x138B3800U,
566        0x134B4000U,
567        0x132B5000U,
568        0x12EB6000U,
569        0x12CB6800U,
570        0x128B7800U,
571        0x124B8000U,
572        0x122B9000U,
573        0x11EBA000U,
574        0x11ABA800U,
575        0x118BB800U,
576        0x114BC000U,
577        0x112BD000U,
578        0x10EBE000U,
579        0x10ABE800U,
580        0x108BF800U,
581        0x104C0000U,
582        0x100C1000U,
583        0x0FEC2000U,
584        0x0FAC2800U,
585        0x0F8C3800U,
586        0x0F4C4000U,
587        0x0F0C5000U,
588        0x0EEC5800U,
589        0x0EAC6800U,
590        0x0E6C7800U,
591        0x0E4C8000U,
592        0x0E0C9000U,
593        0x0DEC9800U,
594        0x0DACA800U,
595        0x0D6CB800U,
596        0x0D4CC000U,
597        0x0D0CD000U,
598        0x0CCCD800U,
599        0x0CACE800U,
600        0x0C6CF800U,
601        0x0C4D0000U,
602        0x0C0D1000U,
603        0x0BCD1800U,
604        0x0BAD2800U,
605        0x0B6D3800U,
606        0x0B2D4000U,
607        0x0B0D5000U,
608        0x0ACD5800U,
609        0x0AAD6800U,
610        0x0A6D7800U,
611        0x0A2D8000U,
612        0x0A0D9000U,
613        0x09CD9800U,
614        0x098DA800U,
615        0x096DB800U,
616        0x092DC000U,
617        0x090DD000U,
618        0x08CDD800U,
619        0x088DE800U,
620        0x086DF800U,
621        0x082E0000U,
622        0x07EE1000U,
623        0x07CE1800U,
624        0x078E2800U,
625        0x076E3800U,
626        0x072E4000U,
627        0x06EE5000U,
628        0x06CE5800U,
629        0x068E6800U,
630        0x064E7800U,
631        0x062E8000U,
632        0x05EE9000U,
633        0x05CE9800U,
634        0x058EA800U,
635        0x054EB800U,
636        0x052EC000U,
637        0x04EED000U,
638        0x04AED800U,
639        0x048EE800U,
640        0x044EF000U,
641        0x042F0000U,
642        0x03EF1000U,
643        0x03AF1800U,
644        0x038F2800U,
645        0x034F3000U,
646        0x030F4000U,
647        0x02EF5000U,
648        0x02AF5800U,
649        0x028F6800U,
650        0x024F7000U,
651        0x020F8000U,
652        0x01EF9000U,
653        0x01AF9800U,
654        0x016FA800U,
655        0x014FB000U,
656        0x010FC000U,
657        0x00EFD000U,
658        0x00AFD800U,
659        0x006FE800U,
660        0x004FF000U,
661        0x00100000U,
662        0xFFD01000U,
663        0xFFB01800U,
664        0xFF702800U,
665        0xFF303000U,
666        0xFF104000U,
667        0xFED05000U,
668        0xFEB05800U,
669        0xFE706800U,
670        0xFE307000U,
671        0xFE108000U,
672        0xFDD09000U,
673        0xFD909800U,
674        0xFD70A800U,
675        0xFD30B000U,
676        0xFD10C000U,
677        0xFCD0D000U,
678        0xFC90D800U,
679        0xFC70E800U,
680        0xFC30F000U,
681        0xFBF10000U,
682        0xFBD11000U,
683        0xFB911800U,
684        0xFB712800U,
685        0xFB313000U,
686        0xFAF14000U,
687        0xFAD14800U,
688        0xFA915800U,
689        0xFA516800U,
690        0xFA317000U,
691        0xF9F18000U,
692        0xF9D18800U,
693        0xF9919800U,
694        0xF951A800U,
695        0xF931B000U,
696        0xF8F1C000U,
697        0xF8B1C800U,
698        0xF891D800U,
699        0xF851E800U,
700        0xF831F000U,
701        0xF7F20000U,
702        0xF7B20800U,
703        0xF7921800U,
704        0xF7522800U,
705        0xF7123000U,
706        0xF6F24000U,
707        0xF6B24800U,
708        0xF6925800U,
709        0xF6526800U,
710        0xF6127000U,
711        0xF5F28000U,
712        0xF5B28800U,
713        0xF5729800U,
714        0xF552A800U,
715        0xF512B000U,
716        0xF4F2C000U,
717        0xF4B2C800U,
718        0xF472D800U,
719        0xF452E800U,
720        0xF412F000U,
721        0xF3D30000U,
722        0xF3B30800U,
723        0xF3731800U,
724        0xF3532800U,
725        0xF3133000U,
726        0xF2D34000U,
727        0xF2B34800U,
728        0xF2735800U,
729        0xF2336800U,
730        0xF2137000U,
731        0xF1D38000U,
732        0xF1B38800U,
733        0xF1739800U,
734        0xF133A800U,
735        0xF113B000U,
736        0xF0D3C000U,
737        0xF093C800U,
738        0xF073D800U,
739        0xF033E000U,
740        0xF013F000U,
741        0xEFD40000U,
742        0xEF940800U,
743        0xEF741800U,
744        0xEF342000U,
745        0xEEF43000U,
746        0xEED44000U,
747        0xEE944800U,
748        0xEE745800U,
749        0xEE346000U,
750        0xEDF47000U,
751        0xEDD48000U,
752        0xED948800U,
753        0xED549800U,
754        0xED34A000U,
755        0xECF4B000U,
756        0xECD4C000U,
757        0xEC94C800U,
758        0xEC54D800U,
759        0xEC34E000U,
760        0xEBF4F000U,
761        0xEBB50000U,
762        0xEB950800U,
763        0xEB551800U,
764        0xEB352000U,
765        0xEAF53000U,
766        0xEAB54000U,
767        0xEA954800U,
768        0xEA555800U,
769        0xEA156000U,
770        0xE9F57000U,
771        0xE9B58000U,
772        0xE9958800U,
773        0xE9559800U,
774        0xE915A000U,
775        0xE8F5B000U,
776        0xE8B5C000U,
777        0xE875C800U,
778        0xE855D800U,
779        0xE815E000U,
780        0xE7F5F000U,
781        0xE7B60000U,
782        0xE7760800U,
783        0xE7561800U,
784        0xE7162000U,
785        0xE6D63000U,
786        0xE6B64000U,
787        0xE6764800U,
788        0xE6365800U
789};