⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jquant2.txt

📁 STM32F103ZET6+UCOSII+UCGUI源码
💻 TXT
📖 第 1 页 / 共 5 页
字号:
00008c  eb0c0c4c          ADD      r12,r12,r12,LSL #1
;;;716          min_dist += tdist*tdist;
000090  fb0c000c          MLA      r0,r12,r12,r0
;;;717          tdist = (x - maxc1) * C1_SCALE;
;;;718          max_dist += tdist*tdist;
000094  e00c              B        |L4.176|
                  |L4.150|
;;;719        } else if (x > maxc1) {
000096  42bc              CMP      r4,r7
000098  dd06              BLE      |L4.168|
;;;720          tdist = (x - maxc1) * C1_SCALE;
00009a  eba40c07          SUB      r12,r4,r7
00009e  eb0c0c4c          ADD      r12,r12,r12,LSL #1
;;;721          min_dist += tdist*tdist;
0000a2  fb0c000c          MLA      r0,r12,r12,r0
;;;722          tdist = (x - minc1) * C1_SCALE;
;;;723          max_dist += tdist*tdist;
0000a6  e005              B        |L4.180|
                  |L4.168|
;;;724        } else {
;;;725          /* within cell range so no contribution to min_dist */
;;;726          if (x <= centerc1) {
0000a8  f8ddc404          LDR      r12,[sp,#0x404]
0000ac  4564              CMP      r4,r12
0000ae  dc01              BGT      |L4.180|
                  |L4.176|
;;;727    	tdist = (x - maxc1) * C1_SCALE;
0000b0  1be4              SUBS     r4,r4,r7
;;;728    	max_dist += tdist*tdist;
0000b2  e000              B        |L4.182|
                  |L4.180|
;;;729          } else {
;;;730    	tdist = (x - minc1) * C1_SCALE;
0000b4  1aa4              SUBS     r4,r4,r2
                  |L4.182|
0000b6  eb040444          ADD      r4,r4,r4,LSL #1       ;727
0000ba  fb045504          MLA      r5,r4,r4,r5           ;728
;;;731    	max_dist += tdist*tdist;
;;;732          }
;;;733        }
;;;734    
;;;735        x = GETJSAMPLE(cinfo->colormap[2][i]);
0000be  f8da4008          LDR      r4,[r10,#8]
0000c2  5da4              LDRB     r4,[r4,r6]
;;;736        if (x < minc2) {
0000c4  429c              CMP      r4,r3
0000c6  da04              BGE      |L4.210|
;;;737          tdist = (x - minc2) * C2_SCALE;
0000c8  eba40c03          SUB      r12,r4,r3
;;;738          min_dist += tdist*tdist;
0000cc  fb0c000c          MLA      r0,r12,r12,r0
;;;739          tdist = (x - maxc2) * C2_SCALE;
;;;740          max_dist += tdist*tdist;
0000d0  e00a              B        |L4.232|
                  |L4.210|
;;;741        } else if (x > maxc2) {
0000d2  4544              CMP      r4,r8
0000d4  dd04              BLE      |L4.224|
;;;742          tdist = (x - maxc2) * C2_SCALE;
0000d6  eba40c08          SUB      r12,r4,r8
;;;743          min_dist += tdist*tdist;
0000da  fb0c000c          MLA      r0,r12,r12,r0
;;;744          tdist = (x - minc2) * C2_SCALE;
;;;745          max_dist += tdist*tdist;
0000de  e006              B        |L4.238|
                  |L4.224|
;;;746        } else {
;;;747          /* within cell range so no contribution to min_dist */
;;;748          if (x <= centerc2) {
0000e0  f8ddc400          LDR      r12,[sp,#0x400]
0000e4  4564              CMP      r4,r12
0000e6  dc02              BGT      |L4.238|
                  |L4.232|
;;;749    	tdist = (x - maxc2) * C2_SCALE;
0000e8  eba40408          SUB      r4,r4,r8
;;;750    	max_dist += tdist*tdist;
0000ec  e000              B        |L4.240|
                  |L4.238|
;;;751          } else {
;;;752    	tdist = (x - minc2) * C2_SCALE;
0000ee  1ae4              SUBS     r4,r4,r3
                  |L4.240|
0000f0  fb045404          MLA      r4,r4,r4,r5           ;750
;;;753    	max_dist += tdist*tdist;
;;;754          }
;;;755        }
;;;756    
;;;757        mindist[i] = min_dist;	/* save away the results */
0000f4  f84d0026          STR      r0,[sp,r6,LSL #2]
;;;758        if (max_dist < minmaxdist)
0000f8  454c              CMP      r4,r9
0000fa  da00              BGE      |L4.254|
;;;759          minmaxdist = max_dist;
0000fc  46a1              MOV      r9,r4
                  |L4.254|
0000fe  1c76              ADDS     r6,r6,#1              ;688
                  |L4.256|
000100  455e              CMP      r6,r11                ;688
000102  db9d              BLT      |L4.64|
;;;760      }
;;;761    
;;;762      /* Now we know that no cell in the update box is more than minmaxdist
;;;763       * away from some colormap entry.  Therefore, only colors that are
;;;764       * within minmaxdist of some part of the box need be considered.
;;;765       */
;;;766      ncolors = 0;
000104  2000              MOVS     r0,#0
;;;767      for (i = 0; i < numcolors; i++) {
000106  4601              MOV      r1,r0
000108  466a              MOV      r2,sp                 ;663
00010a  e008              B        |L4.286|
                  |L4.268|
;;;768        if (mindist[i] <= minmaxdist)
00010c  f8523021          LDR      r3,[r2,r1,LSL #2]
000110  454b              CMP      r3,r9
000112  dc03              BGT      |L4.284|
;;;769          colorlist[ncolors++] = (JSAMPLE) i;
000114  f8dd3440          LDR      r3,[sp,#0x440]
000118  5419              STRB     r1,[r3,r0]
00011a  1c40              ADDS     r0,r0,#1
                  |L4.284|
00011c  1c49              ADDS     r1,r1,#1              ;767
                  |L4.286|
00011e  4559              CMP      r1,r11                ;767
000120  dbf4              BLT      |L4.268|
;;;770      }
;;;771      return ncolors;
;;;772    }
000122  f20d4d1c          ADD      sp,sp,#0x41c
000126  e8bd8ff0          POP      {r4-r11,pc}
;;;773    
                          ENDP


                          AREA ||i.finish_pass1||, CODE, READONLY, ALIGN=1

                  finish_pass1 PROC
;;;1143   METHODDEF(void)
;;;1144   finish_pass1 (j_decompress_ptr cinfo)
000000  b510              PUSH     {r4,lr}
;;;1145   {
;;;1146     my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
;;;1147   
;;;1148     /* Select the representative colors and fill in cinfo->colormap */
;;;1149     cinfo->colormap = cquantize->sv_colormap;
000002  f8d041cc          LDR      r4,[r0,#0x1cc]
000006  6921              LDR      r1,[r4,#0x10]
;;;1150     select_colors(cinfo, cquantize->desired);
000008  f8c01088          STR      r1,[r0,#0x88]
00000c  6961              LDR      r1,[r4,#0x14]
00000e  f7fffffe          BL       select_colors
;;;1151     /* Force next pass to zero the color index table */
;;;1152     cquantize->needs_zeroed = TRUE;
000012  2001              MOVS     r0,#1
;;;1153   }
000014  61e0              STR      r0,[r4,#0x1c]
000016  bd10              POP      {r4,pc}
;;;1154   
                          ENDP


                          AREA ||i.finish_pass2||, CODE, READONLY, ALIGN=1

                  finish_pass2 PROC
;;;1156   METHODDEF(void)
;;;1157   finish_pass2 (j_decompress_ptr cinfo)
000000  4770              BX       lr
;;;1158   {
;;;1159     GUI_USE_PARA(cinfo);
;;;1160     /* no work */
;;;1161   }
;;;1162   
                          ENDP


                          AREA ||i.init_error_limit||, CODE, READONLY, ALIGN=2

                  init_error_limit PROC
;;;1108   LOCAL(void)
;;;1109   init_error_limit (j_decompress_ptr cinfo)
000000  b510              PUSH     {r4,lr}
;;;1110   /* Allocate and fill in the error_limiter table */
;;;1111   {
;;;1112     my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
;;;1113     int * table;
;;;1114     int in, out;
;;;1115   
;;;1116     table = (int *) (*cinfo->mem->alloc_small)
000002  6841              LDR      r1,[r0,#4]
000004  f8d041cc          LDR      r4,[r0,#0x1cc]
000008  680b              LDR      r3,[r1,#0]
00000a  f24072fc          MOV      r2,#0x7fc
00000e  2101              MOVS     r1,#1
000010  4798              BLX      r3
;;;1117       ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int));
;;;1118     table += MAXJSAMPLE;		/* so can index -MAXJSAMPLE .. +MAXJSAMPLE */
000012  f500707f          ADD      r0,r0,#0x3fc
;;;1119     cquantize->error_limiter = table;
;;;1120   
;;;1121   #define STEPSIZE ((MAXJSAMPLE+1)/16)
;;;1122     /* Map errors 1:1 up to +- MAXJSAMPLE/16 */
;;;1123     out = 0;
000016  2200              MOVS     r2,#0
;;;1124     for (in = 0; in < STEPSIZE; in++, out++) {
000018  4611              MOV      r1,r2
00001a  62a0              STR      r0,[r4,#0x28]
                  |L7.28|
;;;1125       table[in] = out; table[-in] = -out;
00001c  f8402021          STR      r2,[r0,r1,LSL #2]
000020  4253              RSBS     r3,r2,#0
000022  eba00481          SUB      r4,r0,r1,LSL #2
000026  1c49              ADDS     r1,r1,#1              ;1124
000028  1c52              ADDS     r2,r2,#1              ;1124
00002a  6023              STR      r3,[r4,#0]            ;1124
00002c  2910              CMP      r1,#0x10              ;1124
00002e  dbf5              BLT      |L7.28|
000030  e00b              B        |L7.74|
;;;1126     }
;;;1127     /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */
;;;1128     for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) {
;;;1129       table[in] = out; table[-in] = -out;
000032  bf00              NOP      
                  |L7.52|
000034  f8402021          STR      r2,[r0,r1,LSL #2]
000038  eba00481          SUB      r4,r0,r1,LSL #2
00003c  4253              RSBS     r3,r2,#0
00003e  1c49              ADDS     r1,r1,#1              ;1128
000040  6023              STR      r3,[r4,#0]            ;1128
000042  f3410300          SBFX     r3,r1,#0,#1           ;1128
000046  441a              ADD      r2,r2,r3              ;1128
000048  1c52              ADDS     r2,r2,#1              ;1128
                  |L7.74|
00004a  2930              CMP      r1,#0x30              ;1128
00004c  dbf2              BLT      |L7.52|
00004e  4253              RSBS     r3,r2,#0              ;1125
;;;1130     }
;;;1131     /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */
;;;1132     for (; in <= MAXJSAMPLE; in++) {
000050  e006              B        |L7.96|
;;;1133       table[in] = out; table[-in] = -out;
000052  bf00              NOP      
                  |L7.84|
000054  f8402021          STR      r2,[r0,r1,LSL #2]
000058  eba00481          SUB      r4,r0,r1,LSL #2
00005c  1c49              ADDS     r1,r1,#1              ;1132
00005e  6023              STR      r3,[r4,#0]            ;1132
                  |L7.96|
000060  29ff              CMP      r1,#0xff              ;1132
000062  ddf7              BLE      |L7.84|
;;;1134     }
;;;1135   #undef STEPSIZE
;;;1136   }
000064  bd10              POP      {r4,pc}
;;;1137   
                          ENDP


                          AREA ||i.jinit_2pass_quantizer||, CODE, READONLY, ALIGN=2

                  jinit_2pass_quantizer PROC
;;;1245   GLOBAL(void)
;;;1246   jinit_2pass_quantizer (j_decompress_ptr cinfo)
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;1247   {
000004  4604              MOV      r4,r0
;;;1248     my_cquantize_ptr cquantize;
;;;1249     int i;
;;;1250   
;;;1251     cquantize = (my_cquantize_ptr)
000006  6840              LDR      r0,[r0,#4]
000008  222c              MOVS     r2,#0x2c
00000a  6803              LDR      r3,[r0,#0]
00000c  2101              MOVS     r1,#1
00000e  4620              MOV      r0,r4
000010  4798              BLX      r3

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -