xref: /utopia/UTPA2-700.0.x/modules/xc/drv/xc/mdrv_ld_gamma.c (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 //<MStar Software>
2 //******************************************************************************
3 // MStar Software
4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
5 // All software, firmware and related documentation herein ("MStar Software") are
6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
7 // law, including, but not limited to, copyright law and international treaties.
8 // Any use, modification, reproduction, retransmission, or republication of all
9 // or part of MStar Software is expressly prohibited, unless prior written
10 // permission has been granted by MStar.
11 //
12 // By accessing, browsing and/or using MStar Software, you acknowledge that you
13 // have read, understood, and agree, to be bound by below terms ("Terms") and to
14 // comply with all applicable laws and regulations:
15 //
16 // 1. MStar shall retain any and all right, ownership and interest to MStar
17 //    Software and any modification/derivatives thereof.
18 //    No right, ownership, or interest to MStar Software and any
19 //    modification/derivatives thereof is transferred to you under Terms.
20 //
21 // 2. You understand that MStar Software might include, incorporate or be
22 //    supplied together with third party`s software and the use of MStar
23 //    Software may require additional licenses from third parties.
24 //    Therefore, you hereby agree it is your sole responsibility to separately
25 //    obtain any and all third party right and license necessary for your use of
26 //    such third party`s software.
27 //
28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as
29 //    MStar`s confidential information and you agree to keep MStar`s
30 //    confidential information in strictest confidence and not disclose to any
31 //    third party.
32 //
33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any
34 //    kind. Any warranties are hereby expressly disclaimed by MStar, including
35 //    without limitation, any warranties of merchantability, non-infringement of
36 //    intellectual property rights, fitness for a particular purpose, error free
37 //    and in conformity with any international standard.  You agree to waive any
38 //    claim against MStar for any loss, damage, cost or expense that you may
39 //    incur related to your use of MStar Software.
40 //    In no event shall MStar be liable for any direct, indirect, incidental or
41 //    consequential damages, including without limitation, lost of profit or
42 //    revenues, lost or damage of data, and unauthorized system use.
43 //    You agree that this Section 4 shall still apply without being affected
44 //    even if MStar Software has been modified by MStar in accordance with your
45 //    request or instruction for your use, except otherwise agreed by both
46 //    parties in writing.
47 //
48 // 5. If requested, MStar may from time to time provide technical supports or
49 //    services in relation with MStar Software to you for your use of
50 //    MStar Software in conjunction with your or your customer`s product
51 //    ("Services").
52 //    You understand and agree that, except otherwise agreed by both parties in
53 //    writing, Services are provided on an "AS IS" basis and the warranty
54 //    disclaimer set forth in Section 4 above shall apply.
55 //
56 // 6. Nothing contained herein shall be construed as by implication, estoppels
57 //    or otherwise:
58 //    (a) conferring any license or right to use MStar name, trademark, service
59 //        mark, symbol or any other identification;
60 //    (b) obligating MStar or any of its affiliates to furnish any person,
61 //        including without limitation, you and your customers, any assistance
62 //        of any kind whatsoever, or any information; or
63 //    (c) conferring any license or right under any intellectual property right.
64 //
65 // 7. These terms shall be governed by and construed in accordance with the laws
66 //    of Taiwan, R.O.C., excluding its conflict of law rules.
67 //    Any and all dispute arising out hereof or related hereto shall be finally
68 //    settled by arbitration referred to the Chinese Arbitration Association,
69 //    Taipei in accordance with the ROC Arbitration Law and the Arbitration
70 //    Rules of the Association by three (3) arbitrators appointed in accordance
71 //    with the said Rules.
72 //    The place of arbitration shall be in Taipei, Taiwan and the language shall
73 //    be English.
74 //    The arbitration award shall be final and binding to both parties.
75 //
76 //******************************************************************************
77 //<MStar Software>
78 ////////////////////////////////////////////////////////////////////////////////
79 //
80 // Copyright (c) 2008-2010 MStar Semiconductor, Inc.
81 // All rights reserved.
82 //
83 // Unless otherwise stipulated in writing, any and all information contained
84 // herein regardless in any format shall remain the sole proprietary of
85 // MStar Semiconductor Inc. and be kept in strict confidence
86 // ("MStar Confidential Information") by the recipient.
87 // Any unauthorized act including without limitation unauthorized disclosure,
88 // copying, use, reproduction, sale, distribution, modification, disassembling,
89 // reverse engineering and compiling of the contents of MStar Confidential
90 // Information is unlawful and strictly prohibited. MStar hereby reserves the
91 // rights to any and all damages, losses, costs and expenses resulting therefrom.
92 //
93 ////////////////////////////////////////////////////////////////////////////////
94 
95 ///////////////////////////////////////////////////////////////////////////////////////////////////
96 /// file    Mdrv_ld_Gamma.c
97 /// @brief  local dimming gamma table
98 /// @author MStar Semiconductor Inc.
99 ///////////////////////////////////////////////////////////////////////////////////////////////////
100 #include "mdrv_ld_gamma.h"
101 
102 #if  (LD_ENABLE==1)
103 const MS_U8 gamma_linear[64]=
104 {
105 
106   0    ,
107   4    ,
108   8    ,
109   12   ,
110   16   ,
111   20   ,
112   24   ,
113   28   ,
114   32   ,
115   36   ,
116   40   ,
117   44   ,
118   48   ,
119   52   ,
120   56   ,
121   60   ,
122   64   ,
123   68   ,
124   72   ,
125   76   ,
126   80   ,
127   85   ,
128   89   ,
129   93   ,
130   97   ,
131   101  ,
132   105  ,
133   109  ,
134   113  ,
135   117  ,
136   121  ,
137   125  ,
138   129  ,
139   133  ,
140   137  ,
141   141  ,
142   145  ,
143   149  ,
144   153  ,
145   157  ,
146   161  ,
147   165  ,
148   170  ,
149   174  ,
150   178  ,
151   182  ,
152   186  ,
153   190  ,
154   194  ,
155   198  ,
156   202  ,
157   206  ,
158   210  ,
159   214  ,
160   218  ,
161   222  ,
162   226  ,
163   230  ,
164   234  ,
165   238  ,
166   242  ,
167   246  ,
168   250  ,
169   255
170 };
171 
172 
173 const MS_U8 gamma_0dot6[64]=
174 {
175   0      ,
176   21     ,
177   32     ,
178   41     ,
179   48     ,
180   55     ,
181   62     ,
182   68     ,
183   73     ,
184   79     ,
185   84     ,
186   89     ,
187   94     ,
188   98     ,
189   103     ,
190   107     ,
191   112     ,
192   116     ,
193   120     ,
194   124     ,
195   128     ,
196   131     ,
197   135     ,
198   139     ,
199   142     ,
200   146     ,
201   149     ,
202   153     ,
203   156     ,
204   160     ,
205   163     ,
206   166     ,
207   169     ,
208   172     ,
209   176     ,
210   179     ,
211   182     ,
212   185     ,
213   188     ,
214   191     ,
215   194     ,
216   197     ,
217   199     ,
218   202     ,
219   205     ,
220   208     ,
221   211     ,
222   213     ,
223   216     ,
224   219     ,
225   221     ,
226   224     ,
227   227     ,
228   229     ,
229   232     ,
230   235     ,
231   237     ,
232   240     ,
233   242     ,
234   245     ,
235   247     ,
236   250     ,
237   252     ,
238   255
239 };
240 
241 const MS_U8 gamma_0dot4[64]=
242 {
243    0      ,
244    48       ,
245    64       ,
246    75       ,
247    84       ,
248    92       ,
249    99       ,
250    105     ,
251    111     ,
252    117     ,
253    122     ,
254    126     ,
255    131     ,
256    135     ,
257    139     ,
258    143     ,
259    147     ,
260    151     ,
261    154     ,
262    157     ,
263    161     ,
264    164     ,
265    167     ,
266    170     ,
267    173     ,
268    176     ,
269    178     ,
270    181     ,
271    184     ,
272    186     ,
273    189     ,
274    192     ,
275    194     ,
276    196     ,
277    199     ,
278    201     ,
279    203     ,
280    206     ,
281    208     ,
282    210     ,
283    212     ,
284    214     ,
285    216     ,
286    218     ,
287    220     ,
288    222     ,
289    224     ,
290    226     ,
291    228     ,
292    230     ,
293    232     ,
294    234     ,
295    236     ,
296    237     ,
297    239     ,
298    241     ,
299    243     ,
300    244     ,
301    246     ,
302    248     ,
303    250     ,
304    251     ,
305    253     ,
306    255
307 };
308 
309 
310 const MS_U8 gamma_1dot2[64]=
311 {
312     0        ,
313     1        ,
314     4        ,
315     6        ,
316     9        ,
317     12        ,
318     15        ,
319     18        ,
320     21        ,
321     24        ,
322     28        ,
323     31        ,
324     34        ,
325     38        ,
326     41        ,
327     45        ,
328     49        ,
329     52        ,
330     56        ,
331     60        ,
332     64        ,
333     68        ,
334     72        ,
335     76        ,
336     80        ,
337     84        ,
338     88        ,
339     92        ,
340     96        ,
341     100     ,
342     104     ,
343     108     ,
344     113     ,
345     117     ,
346     121     ,
347     125     ,
348     130     ,
349     134     ,
350     139     ,
351     143     ,
352     147     ,
353     152     ,
354     156     ,
355     161     ,
356     165     ,
357     170     ,
358     174     ,
359     179     ,
360     184     ,
361     188     ,
362     193     ,
363     197     ,
364     202     ,
365     207     ,
366     211     ,
367     216     ,
368     221     ,
369     226     ,
370     230     ,
371     235     ,
372     240     ,
373     245     ,
374     250     ,
375     255
376 };
377 
378 
379 const MS_U8 gamma_1dot4[64]=
380 {
381   0       ,
382   0       ,
383   2       ,
384   3       ,
385   5       ,
386   7       ,
387   9       ,
388   11      ,
389   14      ,
390   16      ,
391   19      ,
392   22      ,
393   25      ,
394   27      ,
395   31      ,
396   34      ,
397   37      ,
398   40      ,
399   44      ,
400   47      ,
401   51      ,
402   54      ,
403   58      ,
404   62      ,
405   66      ,
406   69      ,
407   73      ,
408   77      ,
409   81      ,
410   86      ,
411   90      ,
412   94      ,
413   98      ,
414   103      ,
415   107      ,
416   111      ,
417   116      ,
418   121      ,
419   125      ,
420   130      ,
421   135      ,
422   139      ,
423   144      ,
424   149      ,
425   154      ,
426   159      ,
427   164      ,
428   169      ,
429   174      ,
430   179      ,
431   184      ,
432   189      ,
433   194      ,
434   200      ,
435   205      ,
436   210      ,
437   216      ,
438   221      ,
439   227      ,
440   232      ,
441   238      ,
442   243      ,
443   249      ,
444   255
445 };
446 
447 
448 const MS_U8 gamma_0dot9[64] =
449 {
450     0      ,
451     6      ,
452     11     ,
453     16     ,
454     21     ,
455     26     ,
456     30     ,
457     35     ,
458     39     ,
459     44     ,
460     48     ,
461     53     ,
462     57     ,
463     61     ,
464     65     ,
465     70     ,
466     74     ,
467     78     ,
468     82     ,
469     86     ,
470     90     ,
471     94     ,
472     98     ,
473     102    ,
474     106    ,
475     110    ,
476     114    ,
477     118    ,
478     122    ,
479     126    ,
480     130    ,
481     134    ,
482     138    ,
483     142    ,
484     146    ,
485     150    ,
486     154    ,
487     157    ,
488     161    ,
489     165    ,
490     169    ,
491     173    ,
492     177    ,
493     180    ,
494     184    ,
495     188    ,
496     192    ,
497     195    ,
498     199    ,
499     203    ,
500     207    ,
501     210    ,
502     214    ,
503     218    ,
504     221    ,
505     225    ,
506     229    ,
507     233    ,
508     236    ,
509     240    ,
510     244    ,
511     247    ,
512     251    ,
513     255
514 } ;
515 
516 
517 const MS_U8 gamma_0dot8[64] =
518 {
519     0    ,
520     9    ,
521     16   ,
522     22   ,
523     28   ,
524     33   ,
525     38   ,
526     43   ,
527     48   ,
528     53   ,
529     58   ,
530     63   ,
531     67   ,
532     72   ,
533     76   ,
534     80   ,
535     85   ,
536     89   ,
537     93   ,
538     97   ,
539     101  ,
540     105  ,
541     109  ,
542     113  ,
543     117  ,
544     121  ,
545     125  ,
546     129  ,
547     133  ,
548     137  ,
549     140  ,
550     144  ,
551     148  ,
552     152  ,
553     155  ,
554     159  ,
555     162  ,
556     166  ,
557     170  ,
558     173  ,
559     177  ,
560     180  ,
561     184  ,
562     187  ,
563     191  ,
564     194  ,
565     198  ,
566     201  ,
567     205  ,
568     208  ,
569     211  ,
570     215  ,
571     218  ,
572     222  ,
573     225  ,
574     228  ,
575     232  ,
576     235  ,
577     238  ,
578     241  ,
579     245  ,
580     248  ,
581     251  ,
582     255
583 } ;
584 
585 
586 const MS_U8 gamma_0dot75[64]=
587 {
588     0       ,
589     11       ,
590     19       ,
591     25       ,
592     32       ,
593     38       ,
594     43       ,
595     49       ,
596     54       ,
597     59       ,
598     64       ,
599     68       ,
600     73       ,
601     78       ,
602     82       ,
603     86       ,
604     91       ,
605     95       ,
606     99       ,
607     103    ,
608     107    ,
609     111    ,
610     115    ,
611     119    ,
612     123    ,
613     127    ,
614     131    ,
615     135    ,
616     138    ,
617     142    ,
618     146    ,
619     149    ,
620     153    ,
621     157    ,
622     160    ,
623     164    ,
624     167    ,
625     171    ,
626     174    ,
627     177    ,
628     181    ,
629     184    ,
630     188    ,
631     191    ,
632     194    ,
633     198    ,
634     201    ,
635     204    ,
636     207    ,
637     211    ,
638     214    ,
639     217    ,
640     220    ,
641     223    ,
642     227    ,
643     230    ,
644     233    ,
645     236    ,
646     239    ,
647     242    ,
648     245    ,
649     248    ,
650     251    ,
651     255
652 
653 
654 };
655 
656 const MS_U8 LGE_sample3[64]=
657 {
658     0     ,
659     6     ,
660     14    ,
661     21    ,
662     29    ,
663     40    ,
664     52    ,
665     68    ,
666     80    ,
667     97    ,
668     117   ,
669     129   ,
670     145   ,
671     153   ,
672     165   ,
673     174   ,
674     182   ,
675     190   ,
676     198   ,
677     204   ,
678     209   ,
679     216   ,
680     221   ,
681     226   ,
682     230   ,
683     234   ,
684     238   ,
685     242   ,
686     246   ,
687     248   ,
688     250   ,
689     251   ,
690     253   ,
691     254   ,
692     255   ,
693     255   ,
694     255   ,
695     255   ,
696     255   ,
697     255   ,
698     255   ,
699     255   ,
700     255   ,
701     255   ,
702     255   ,
703     255   ,
704     255   ,
705     255   ,
706     255   ,
707     255   ,
708     255   ,
709     255   ,
710     255   ,
711     255   ,
712     255   ,
713     255   ,
714     255   ,
715     255   ,
716     255   ,
717     255   ,
718     255   ,
719     255   ,
720     255   ,
721     255
722 };
723 
724 
725 const MS_U8 LGE_sampleTHX[64]=
726 {
727     0,
728     2,
729     4,
730     6,
731     9,
732     20,
733     24,
734     28,
735     32,
736     36,
737     40,
738     44,
739     48,
740     52,
741     56,
742     60,
743     64,
744     68,
745     72,
746     76,
747     80,
748     85,
749     89,
750     93,
751     97,
752     101,
753     105,
754     109,
755     113,
756     117,
757     121,
758     125,
759     129,
760     133,
761     137,
762     141,
763     145,
764     149,
765     153,
766     157,
767     161,
768     165,
769     170,
770     174,
771     178,
772     182,
773     186,
774     190,
775     194,
776     198,
777     202,
778     206,
779     210,
780     214,
781     218,
782     222,
783     255,
784     255,
785     255,
786     255,
787     255,
788     255,
789     255,
790     255
791 };
792 
793 
794 const MS_U8 gamma_0dot78[64]=
795 {
796     0       ,
797     10       ,
798     17       ,
799     23       ,
800     29       ,
801     35       ,
802     40       ,
803     45       ,
804     50       ,
805     55       ,
806     60       ,
807     65       ,
808     69       ,
809     74       ,
810     78       ,
811     83       ,
812     87       ,
813     91       ,
814     95       ,
815     100    ,
816     104    ,
817     108    ,
818     112    ,
819     116    ,
820     120    ,
821     124    ,
822     127    ,
823     131    ,
824     135    ,
825     139    ,
826     142    ,
827     146    ,
828     150    ,
829     153    ,
830     157    ,
831     161    ,
832     164    ,
833     168    ,
834     171    ,
835     175    ,
836     178    ,
837     182    ,
838     185    ,
839     189    ,
840     192    ,
841     196    ,
842     199    ,
843     202    ,
844     206    ,
845     209    ,
846     212    ,
847     216    ,
848     219    ,
849     222    ,
850     226    ,
851     229    ,
852     232    ,
853     235    ,
854     239    ,
855     242    ,
856     245    ,
857     248    ,
858     251    ,
859     255
860 
861 };
862 
863 const MS_U8 gamma_0dot7[64]=
864 {
865     0      ,
866     14     ,
867     22     ,
868     30     ,
869     37     ,
870     43     ,
871     49     ,
872     54     ,
873     60     ,
874     65     ,
875     70     ,
876     75     ,
877     79     ,
878     84     ,
879     88     ,
880     93     ,
881     97     ,
882     101    ,
883     106    ,
884     110    ,
885     114    ,
886     118    ,
887     122    ,
888     125    ,
889     129    ,
890     133    ,
891     137    ,
892     140    ,
893     144    ,
894     148    ,
895     151    ,
896     155    ,
897     158    ,
898     162    ,
899     165    ,
900     168    ,
901     172    ,
902     175    ,
903     178    ,
904     182    ,
905     185    ,
906     188    ,
907     191    ,
908     195    ,
909     198    ,
910     201    ,
911     204    ,
912     207    ,
913     210    ,
914     213    ,
915     216    ,
916     219    ,
917     222    ,
918     225    ,
919     228    ,
920     231    ,
921     234    ,
922     237    ,
923     240    ,
924     243    ,
925     246    ,
926     249    ,
927     252    ,
928     255
929 };
930 
931 
932 const MS_U8 gamma_dark_higher[64]=
933 {
934   0    ,
935   18    ,
936   21    ,
937   22   ,
938   23   ,
939   24   ,
940   26   ,
941   28   ,
942   32   ,
943   36   ,
944   40   ,
945   44   ,
946   48   ,
947   52   ,
948   56   ,
949   60   ,
950   64   ,
951   68   ,
952   72   ,
953   76   ,
954   80   ,
955   85   ,
956   89   ,
957   93   ,
958   97   ,
959   101  ,
960   105  ,
961   109  ,
962   113  ,
963   117  ,
964   121  ,
965   125  ,
966   129  ,
967   133  ,
968   137  ,
969   141  ,
970   145  ,
971   149  ,
972   153  ,
973   157  ,
974   161  ,
975   165  ,
976   170  ,
977   174  ,
978   178  ,
979   182  ,
980   186  ,
981   190  ,
982   194  ,
983   198  ,
984   202  ,
985   206  ,
986   210  ,
987   214  ,
988   218  ,
989   222  ,
990   226  ,
991   230  ,
992   234  ,
993   238  ,
994   242  ,
995   246  ,
996   250  ,
997   255
998 };
999 
1000 
1001 const MS_U8 LGE_sample1_adjust[64*9]=
1002 {
1003     0    ,0     ,0     ,0        ,0        ,0        ,0     ,0     ,0       ,
1004     36    ,14  ,8     ,6        ,5        ,5        ,3     ,0     ,0       ,
1005     48    ,21  ,14    ,11     ,10     ,9        ,6     ,1     ,0       ,
1006     57    ,27  ,18    ,15     ,13     ,12     ,8     ,2     ,1       ,
1007     69    ,35  ,25    ,21     ,19     ,18     ,13  ,5     ,2       ,
1008     77    ,42  ,31    ,27     ,24     ,23     ,17  ,7     ,3       ,
1009     87    ,51  ,39    ,34     ,31     ,29     ,22  ,10    ,6       ,
1010     96    ,59  ,46    ,40     ,38     ,36     ,28  ,13    ,8       ,
1011     103 ,66  ,52    ,47     ,44     ,42     ,33  ,17    ,10    ,
1012     110 ,72  ,59    ,53     ,50     ,48     ,39  ,20    ,13    ,
1013     117 ,79  ,65    ,59     ,55     ,53     ,44  ,24    ,16    ,
1014     122 ,85  ,71    ,64     ,61     ,59     ,49  ,28    ,19    ,
1015     128 ,91  ,76    ,70     ,66     ,64     ,54  ,32    ,23    ,
1016     133 ,96  ,82    ,75     ,72     ,69     ,59  ,36    ,26    ,
1017     138 ,101 ,87    ,81     ,77     ,75     ,64  ,40    ,30    ,
1018     142 ,107 ,92    ,86     ,82     ,80     ,69  ,44    ,33    ,
1019     147 ,112 ,97    ,91     ,87     ,85     ,74  ,49    ,37    ,
1020     151 ,116 ,102    ,96     ,92     ,90     ,79  ,53    ,41    ,
1021     155 ,121 ,107    ,101    ,97     ,94     ,83  ,57    ,45    ,
1022     159 ,126 ,112    ,105    ,102    ,99     ,88  ,62    ,49    ,
1023     163 ,130 ,116    ,110    ,106    ,104    ,93  ,66    ,53    ,
1024     166 ,135 ,121    ,115    ,111    ,109    ,98  ,71    ,57    ,
1025     170 ,139 ,125    ,119    ,116    ,113    ,102 ,76    ,62    ,
1026     173 ,143 ,130    ,124    ,120    ,118    ,107 ,80    ,66    ,
1027     177 ,147 ,134    ,128    ,125    ,123    ,112 ,85    ,71    ,
1028     180 ,151 ,139    ,133    ,129    ,127    ,116 ,90    ,75    ,
1029     183 ,155 ,143    ,137    ,134    ,132    ,121 ,94    ,80    ,
1030     186 ,159 ,147    ,141    ,138    ,136    ,126 ,99    ,85    ,
1031     189 ,163 ,151    ,146    ,142    ,140    ,130 ,104    ,90    ,
1032     192 ,167 ,155    ,150    ,147    ,145    ,135 ,109    ,95    ,
1033     195 ,170 ,159    ,154    ,151    ,149    ,139 ,114    ,100   ,
1034     198 ,174 ,163    ,158    ,155    ,153    ,144 ,119    ,105   ,
1035     200 ,178 ,167    ,162    ,160    ,158    ,148 ,124    ,110   ,
1036     203 ,181 ,171    ,167    ,164    ,162    ,153 ,129    ,115   ,
1037     206 ,185 ,175    ,171    ,168    ,166    ,157 ,134    ,121   ,
1038     208 ,188 ,179    ,175    ,172    ,170    ,162 ,139    ,126   ,
1039     211 ,192 ,183    ,179    ,176    ,174    ,166 ,144    ,131   ,
1040     213 ,195 ,187    ,183    ,180    ,179    ,171 ,150    ,137   ,
1041     216 ,198 ,190    ,187    ,184    ,183    ,175 ,155    ,142   ,
1042     218 ,202 ,194    ,190    ,188    ,187    ,180 ,160    ,148   ,
1043     220 ,205 ,198    ,194    ,192    ,191    ,184 ,165    ,154   ,
1044     223 ,208 ,202    ,198    ,196    ,195    ,189 ,171    ,160   ,
1045     225 ,212 ,205    ,202    ,200    ,199    ,193 ,176    ,165   ,
1046     227 ,215 ,209    ,206    ,204    ,203    ,197 ,181    ,171   ,
1047     229 ,218 ,212    ,210    ,208    ,207    ,202 ,187    ,177   ,
1048     232 ,221 ,216    ,213    ,212    ,211    ,206 ,192    ,183   ,
1049     234 ,224 ,219    ,217    ,216    ,215    ,210 ,197    ,189   ,
1050     236 ,227 ,223    ,221    ,220    ,219    ,215 ,203    ,195   ,
1051     238 ,230 ,226    ,225    ,223    ,223    ,219 ,208    ,201   ,
1052     240 ,233 ,230    ,228    ,227    ,227    ,223 ,214    ,208   ,
1053     242 ,236 ,233    ,232    ,231    ,230    ,228 ,219    ,214   ,
1054     244 ,239 ,237    ,236    ,235    ,234    ,232 ,225    ,220   ,
1055     246 ,242 ,240    ,239    ,239    ,238    ,236 ,230    ,227   ,
1056     248 ,245 ,244    ,243    ,242    ,242    ,240 ,236    ,233   ,
1057     250 ,248 ,247    ,246    ,246    ,246    ,245 ,242    ,240   ,
1058     252 ,251 ,250    ,250    ,250    ,250    ,249 ,247    ,246   ,
1059     255 ,255 ,255    ,255    ,255    ,255    ,255 ,255    ,255   ,
1060     255 ,255 ,255    ,255    ,255    ,255    ,255 ,255    ,255   ,
1061     255 ,255 ,255    ,255    ,255    ,255    ,255 ,255    ,255   ,
1062     255 ,255 ,255    ,255    ,255    ,255    ,255 ,255    ,255   ,
1063     255 ,255 ,255    ,255    ,255    ,255    ,255 ,255    ,255   ,
1064     255 ,255 ,255    ,255    ,255    ,255    ,255 ,255    ,255   ,
1065     255 ,255 ,255    ,255    ,255    ,255    ,255 ,255    ,255   ,
1066     255 ,255 ,255    ,255    ,255    ,255    ,255 ,255    ,255
1067 };
1068 
1069 
1070 const MS_U8 LGE_sample2_adjust[64*9]=
1071 {
1072     0    ,0        ,0       ,0       ,0        ,0       , 0       ,0       ,0    ,
1073     33    ,12        ,7       ,5       ,4        ,4       , 2       ,0       ,0    ,
1074     44    ,18        ,11       ,9       ,8        ,7       , 5       ,1       ,0    ,
1075     52    ,23        ,15       ,13       ,11        ,10       , 7       ,2       ,0    ,
1076     57    ,27        ,18       ,15       ,13        ,12       , 8       ,2       ,1    ,
1077     64    ,32        ,22       ,19       ,17        ,16       , 11       ,4       ,2    ,
1078     75    ,41        ,30       ,25       ,23        ,22       , 16       ,6       ,3    ,
1079     84    ,48        ,37       ,32       ,29        ,28       , 21       ,9       ,5    ,
1080     92    ,55        ,43       ,38       ,35        ,33       , 26       ,12       ,7    ,
1081     102    ,64        ,51       ,45       ,42        ,40       , 32       ,16       ,10   ,
1082     110    ,72        ,59       ,53       ,49        ,47       , 38       ,20       ,13   ,
1083     118    ,80        ,66       ,60       ,56        ,54       , 45       ,25       ,17   ,
1084     125    ,87        ,73       ,66       ,63        ,61       , 51       ,30       ,21   ,
1085     131    ,94        ,79       ,73       ,69        ,67       , 57       ,34       ,25   ,
1086     137    ,100    ,86       ,79       ,76        ,73       , 63       ,39       ,29   ,
1087     142    ,106    ,92       ,86       ,82        ,80       , 69       ,44       ,33   ,
1088     148    ,112    ,98       ,92       ,88        ,86       , 75       ,49       ,38   ,
1089     153    ,118    ,104    ,97       ,94        ,91       , 80       ,55       ,42   ,
1090     157    ,124    ,110    ,103    ,100    ,97       , 86       ,60       ,47   ,
1091     162    ,129    ,115    ,109    ,105    ,103    ,92       ,65       ,52   ,
1092     166    ,134    ,121    ,115    ,111    ,109    ,98       ,71       ,57   ,
1093     171    ,140    ,126    ,120    ,116    ,114    ,103    ,76       ,62   ,
1094     175    ,145    ,132    ,125    ,122    ,120    ,109    ,82       ,68   ,
1095     178    ,149    ,137    ,131    ,127    ,125    ,114    ,88       ,73   ,
1096     182    ,154    ,142    ,136    ,133    ,130    ,120    ,93       ,79   ,
1097     186    ,159    ,147    ,141    ,138    ,136    ,126    ,99       ,85   ,
1098     190    ,164    ,152    ,146    ,143    ,141    ,131    ,105    ,91  ,
1099     193    ,168    ,157    ,151    ,148    ,146    ,137    ,111    ,97  ,
1100     196    ,172    ,162    ,157    ,153    ,152    ,142    ,117    ,103 ,
1101     200    ,177    ,166    ,161    ,159    ,157    ,147    ,123    ,109 ,
1102     203    ,181    ,171    ,166    ,164    ,162    ,153    ,129    ,115 ,
1103     206    ,185    ,176    ,171    ,169    ,167    ,158    ,135    ,121 ,
1104     209    ,190    ,180    ,176    ,174    ,172    ,164    ,141    ,128 ,
1105     212    ,194    ,185    ,181    ,178    ,177    ,169    ,147    ,135 ,
1106     215    ,198    ,190    ,186    ,183    ,182    ,174    ,154    ,141 ,
1107     218    ,202    ,194    ,190    ,188    ,187    ,180    ,160    ,148 ,
1108     221    ,206    ,198    ,195    ,193    ,192    ,185    ,166    ,155 ,
1109     224    ,210    ,203    ,200    ,198    ,196    ,190    ,173    ,162 ,
1110     226    ,213    ,207    ,204    ,202    ,201    ,195    ,179    ,169 ,
1111     229    ,217    ,212    ,209    ,207    ,206    ,201    ,185    ,176 ,
1112     232    ,221    ,216    ,213    ,212    ,211    ,206    ,192    ,183 ,
1113     234    ,225    ,220    ,218        ,216    ,216    ,211    ,198    ,190 ,
1114     237    ,228    ,224    ,222        ,221    ,220    ,216    ,205    ,198 ,
1115     239    ,232    ,228    ,227        ,226    ,225    ,221    ,211    ,205 ,
1116     242    ,236    ,233    ,231        ,230    ,230    ,227    ,218    ,212 ,
1117     244    ,239    ,237    ,235        ,235    ,234    ,232    ,225    ,220 ,
1118     247    ,243    ,241    ,240        ,239    ,239    ,237    ,231    ,228 ,
1119     249    ,246    ,245    ,244        ,244    ,243    ,242    ,238    ,235 ,
1120     251    ,250    ,249    ,248        ,248    ,248    ,247    ,245    ,243 ,
1121     254    ,253    ,253    ,253        ,253    ,253    ,252    ,252    ,251 ,
1122     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1123     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1124     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1125     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1126     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1127     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1128     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1129     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1130     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1131     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1132     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1133     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1134     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255 ,
1135     255    ,255    ,255    ,255        ,255    ,255    ,255    ,255    ,255
1136 };
1137 
1138 
1139 const MS_U8 LGE_sample7_adjust[64*9]=
1140 {
1141     0    ,0        ,0        ,0        ,0        ,0        ,0        ,0        ,0   ,
1142     19    ,5        ,2        ,2        ,1        ,1        ,0        ,0        ,0   ,
1143     30    ,10        ,6        ,4        ,3        ,3        ,2        ,0        ,0   ,
1144     39    ,15        ,9        ,7        ,6        ,6        ,3        ,0        ,0   ,
1145     48    ,21        ,14        ,11        ,10        ,9        ,6        ,1        ,0   ,
1146     57    ,27        ,18        ,15        ,13        ,12        ,8        ,2        ,1   ,
1147     64    ,32        ,22        ,19        ,17        ,16        ,11        ,4        ,2   ,
1148     71    ,37        ,27        ,23        ,21        ,19        ,14        ,5        ,2   ,
1149     77    ,42        ,31        ,27        ,24        ,23        ,17        ,7        ,3   ,
1150     84    ,48        ,37        ,32        ,29        ,28        ,21        ,9        ,5   ,
1151     90    ,53        ,41        ,36        ,33        ,31        ,24        ,11        ,6   ,
1152     95    ,58        ,45        ,40        ,37        ,35        ,27        ,13        ,8   ,
1153     102    ,65        ,52        ,46        ,43        ,41        ,33        ,16        ,10  ,
1154     108    ,71        ,57        ,51        ,48        ,46        ,37        ,19        ,12  ,
1155     116    ,78        ,64        ,58        ,54        ,52        ,43        ,24        ,16  ,
1156     122    ,84        ,70        ,64        ,60        ,58        ,48        ,28        ,19  ,
1157     128    ,90        ,76        ,70        ,66        ,64        ,54        ,32        ,22  ,
1158     133    ,97        ,82        ,76        ,72        ,70        ,59        ,36        ,26  ,
1159     139    ,102    ,88        ,81        ,78        ,76        ,65        ,41        ,30  ,
1160     144    ,108    ,94        ,87        ,83        ,81        ,70        ,46        ,34  ,
1161     149    ,113    ,99        ,93        ,89        ,87        ,76        ,50        ,38  ,
1162     153    ,119    ,105    ,98        ,94        ,92        ,81        ,55        ,43  ,
1163     158    ,124    ,110    ,103    ,100    ,97        ,86        ,60        ,47  ,
1164     162    ,129    ,115    ,109    ,105    ,103    ,92        ,65        ,52  ,
1165     166    ,134    ,120    ,114    ,110    ,108    ,97        ,70        ,57  ,
1166     170    ,139    ,125    ,119    ,115    ,113    ,102    ,75        ,61  ,
1167     173    ,143    ,130    ,124    ,120    ,118    ,107    ,80        ,66  ,
1168     177    ,148    ,135    ,129    ,125    ,123    ,113    ,86        ,71  ,
1169     181    ,152    ,140    ,134    ,130    ,128    ,118    ,91        ,77  ,
1170     184    ,157    ,144    ,139    ,135    ,133    ,123    ,96        ,82  ,
1171     187    ,161    ,149    ,143    ,140    ,138    ,128    ,102    ,87  ,
1172     191    ,165    ,154    ,148    ,145    ,143    ,133    ,107    ,93  ,
1173     194    ,169    ,158    ,153    ,150    ,148    ,138    ,113    ,98  ,
1174     197    ,173    ,163    ,157    ,154    ,153    ,143    ,118    ,104 ,
1175     200    ,177    ,167    ,162    ,159    ,157    ,148    ,124    ,110 ,
1176     203    ,181    ,171    ,167    ,164    ,162    ,153    ,129    ,115 ,
1177     206    ,185    ,176    ,171    ,168    ,167    ,158    ,135    ,121 ,
1178     209    ,189    ,180    ,176    ,173    ,171    ,163    ,140    ,127 ,
1179     212    ,193    ,184    ,180    ,177    ,176    ,168    ,146    ,133 ,
1180     214    ,197    ,188    ,184    ,182    ,180    ,173    ,152    ,139 ,
1181     217    ,200    ,193    ,189    ,186    ,185    ,178    ,158    ,146 ,
1182     220    ,204    ,197    ,193    ,191    ,189    ,183    ,163    ,152 ,
1183     222    ,208    ,201    ,197    ,195    ,194    ,188    ,169    ,158 ,
1184     225    ,211    ,205    ,202    ,200    ,198    ,192    ,175    ,165 ,
1185     227    ,215    ,209    ,206    ,204    ,203    ,197    ,181    ,171 ,
1186     230    ,218    ,213    ,210    ,208    ,207    ,202    ,187    ,178 ,
1187     232    ,222    ,217    ,214    ,213    ,212    ,207    ,193    ,184 ,
1188     235    ,225    ,221    ,218    ,217    ,216    ,212    ,199    ,191 ,
1189     237    ,228    ,224    ,222    ,221    ,220    ,216    ,205    ,198 ,
1190     239    ,232    ,228    ,227    ,225    ,225    ,221    ,211    ,205 ,
1191     241    ,235    ,232    ,231    ,230    ,229    ,226    ,217    ,212 ,
1192     244    ,238    ,236    ,235    ,234    ,233    ,231    ,223    ,219 ,
1193     246    ,242    ,240    ,239    ,238    ,238    ,236    ,230    ,226 ,
1194     248    ,245    ,243    ,243    ,242    ,242    ,240    ,236    ,233 ,
1195     250    ,248    ,247    ,247    ,246    ,246    ,245    ,242    ,240 ,
1196     252    ,251    ,251    ,251    ,250    ,250    ,250    ,248    ,247 ,
1197     255    ,255    ,255    ,255    ,255    ,255    ,255    ,255    ,255 ,
1198     255    ,255    ,255    ,255    ,255    ,255    ,255    ,255    ,255 ,
1199     255    ,255    ,255    ,255    ,255    ,255    ,255    ,255    ,255 ,
1200     255    ,255    ,255    ,255    ,255    ,255    ,255    ,255    ,255 ,
1201     255    ,255    ,255    ,255    ,255    ,255    ,255    ,255    ,255 ,
1202     255    ,255    ,255    ,255    ,255    ,255    ,255    ,255    ,255 ,
1203     255    ,255    ,255    ,255    ,255    ,255    ,255    ,255    ,255 ,
1204     255    ,255    ,255    ,255    ,255    ,255    ,255    ,255    ,255
1205 };
1206 
1207 
1208 const MS_U8 LGE_sample1_0dot81[64]=
1209 {
1210     0      ,
1211     5      ,
1212     8      ,
1213     12      ,
1214     18      ,
1215     22      ,
1216     29      ,
1217     35      ,
1218     41      ,
1219     47      ,
1220     52      ,
1221     58      ,
1222     63      ,
1223     68      ,
1224     73      ,
1225     79      ,
1226     84      ,
1227     88      ,
1228     93      ,
1229     98      ,
1230     103   ,
1231     108   ,
1232     112   ,
1233     117   ,
1234     121   ,
1235     126   ,
1236     130   ,
1237     135   ,
1238     139   ,
1239     144   ,
1240     148   ,
1241     152   ,
1242     157   ,
1243     161   ,
1244     165   ,
1245     169   ,
1246     174   ,
1247     178   ,
1248     182   ,
1249     186   ,
1250     190   ,
1251     194   ,
1252     198   ,
1253     202   ,
1254     206   ,
1255     210   ,
1256     214   ,
1257     218   ,
1258     222   ,
1259     226   ,
1260     230   ,
1261     234   ,
1262     238   ,
1263     242   ,
1264     246   ,
1265     250   ,
1266     255   ,
1267     255   ,
1268     255   ,
1269     255   ,
1270     255   ,
1271     255   ,
1272     255   ,
1273     255
1274 };
1275 #endif
1276