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

📄 jquant1.txt

📁 STM32F103ZET6+UCOSII+UCGUI源码
💻 TXT
📖 第 1 页 / 共 5 页
字号:
00003e  6b64              LDR      r4,[r4,#0x34]
000040  f8526020          LDR      r6,[r2,r0,LSL #2]     ;543
000044  f8511028          LDR      r1,[r1,r8,LSL #2]     ;542
;;;545          col_index = 0;
;;;546    
;;;547          for (col = width; col > 0; col--) {
000048  9a00              LDR      r2,[sp,#0]
00004a  f04f0c00          MOV      r12,#0                ;545
00004e  eb041e8b          ADD      lr,r4,r11,LSL #6      ;544
000052  b17a              CBZ      r2,|L13.116|
                  |L13.84|
;;;548    	/* Form pixel value + dither, range-limit to 0..MAXJSAMPLE,
;;;549    	 * select output value, accumulate into output code for this pixel.
;;;550    	 * Range-limiting need not be done explicitly, as we have extended
;;;551    	 * the colorindex table to produce the right answers for out-of-range
;;;552    	 * inputs.  The maximum dither is +- MAXJSAMPLE; this sets the
;;;553    	 * required amount of padding.
;;;554    	 */
;;;555    	*output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];
000054  781c              LDRB     r4,[r3,#0]
000056  f85e502c          LDR      r5,[lr,r12,LSL #2]
00005a  780f              LDRB     r7,[r1,#0]
00005c  442c              ADD      r4,r4,r5
00005e  5d34              LDRB     r4,[r6,r4]
;;;556    	input_ptr += nc;
;;;557    	output_ptr++;
;;;558    	col_index = (col_index + 1) & ODITHER_MASK;
000060  f10c0c01          ADD      r12,r12,#1
000064  443c              ADD      r4,r4,r7              ;555
000066  f8014b01          STRB     r4,[r1],#1            ;555
00006a  4453              ADD      r3,r3,r10             ;556
00006c  f00c0c0f          AND      r12,r12,#0xf
000070  1e52              SUBS     r2,r2,#1              ;547
000072  d1ef              BNE      |L13.84|
                  |L13.116|
000074  1c40              ADDS     r0,r0,#1              ;540
                  |L13.118|
000076  4550              CMP      r0,r10                ;540
000078  dbd8              BLT      |L13.44|
;;;559          }
;;;560        }
;;;561        /* Advance row index for next row */
;;;562        row_index = (row_index + 1) & ODITHER_MASK;
00007a  f10b0001          ADD      r0,r11,#1
00007e  f000000f          AND      r0,r0,#0xf
000082  f1080801          ADD      r8,r8,#1              ;535
000086  f8c90030          STR      r0,[r9,#0x30]         ;535
                  |L13.138|
00008a  9904              LDR      r1,[sp,#0x10]         ;535
00008c  4588              CMP      r8,r1                 ;535
00008e  dbc3              BLT      |L13.24|
;;;563        cquantize->row_index = row_index;
;;;564      }
;;;565    }
000090  b005              ADD      sp,sp,#0x14
000092  e8bd8ff0          POP      {r4-r11,pc}
;;;566    
                          ENDP


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

                  select_ncolors PROC
;;;185    LOCAL(int)
;;;186    select_ncolors (j_decompress_ptr cinfo, int Ncolors[])
000000  e92d47f0          PUSH     {r4-r10,lr}
;;;187    /* Determine allocation of desired colors to components, */
;;;188    /* and fill in Ncolors[] array to indicate choice. */
;;;189    /* Return value is total number of colors (product of Ncolors[] values). */
;;;190    {
000004  4605              MOV      r5,r0
;;;191      int nc = cinfo->out_color_components; /* number of color components */
;;;192      int max_colors = cinfo->desired_number_of_colors;
;;;193      int total_colors, iroot, i, j;
;;;194      boolean changed;
;;;195      long temp;
;;;196      static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE };
;;;197    
;;;198      /* We can allocate at least the nc'th root of max_colors per component. */
;;;199      /* Compute floor(nc'th root of max_colors). */
;;;200      iroot = 1;
000006  6e07              LDR      r7,[r0,#0x60]
000008  6f84              LDR      r4,[r0,#0x78]
00000a  460e              MOV      r6,r1                 ;190
00000c  2001              MOVS     r0,#1
                  |L14.14|
;;;201      do {
;;;202        iroot++;
00000e  1c40              ADDS     r0,r0,#1
;;;203        temp = iroot;		/* set temp = iroot ** nc */
000010  4601              MOV      r1,r0
;;;204        for (i = 1; i < nc; i++)
000012  2201              MOVS     r2,#1
000014  e001              B        |L14.26|
                  |L14.22|
;;;205          temp *= iroot;
000016  4341              MULS     r1,r0,r1
000018  1c52              ADDS     r2,r2,#1              ;204
                  |L14.26|
00001a  42a2              CMP      r2,r4                 ;204
00001c  dbfb              BLT      |L14.22|
;;;206      } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */
00001e  42b9              CMP      r1,r7
000020  ddf5              BLE      |L14.14|
;;;207      iroot--;			/* now iroot = floor(root) */
000022  f1a00801          SUB      r8,r0,#1
;;;208    
;;;209      /* Must have at least 2 color values per component */
;;;210      if (iroot < 2)
000026  f1b80f02          CMP      r8,#2
00002a  da08              BGE      |L14.62|
;;;211        ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp);
00002c  682a              LDR      r2,[r5,#0]
00002e  2038              MOVS     r0,#0x38
000030  6150              STR      r0,[r2,#0x14]
000032  6828              LDR      r0,[r5,#0]
000034  6181              STR      r1,[r0,#0x18]
000036  6828              LDR      r0,[r5,#0]
000038  6801              LDR      r1,[r0,#0]
00003a  4628              MOV      r0,r5
00003c  4788              BLX      r1
                  |L14.62|
;;;212    
;;;213      /* Initialize to iroot color values for each component */
;;;214      total_colors = 1;
00003e  2001              MOVS     r0,#1
;;;215      for (i = 0; i < nc; i++) {
000040  2100              MOVS     r1,#0
000042  e004              B        |L14.78|
                  |L14.68|
;;;216        Ncolors[i] = iroot;
000044  f8468021          STR      r8,[r6,r1,LSL #2]
;;;217        total_colors *= iroot;
000048  fb00f008          MUL      r0,r0,r8
00004c  1c49              ADDS     r1,r1,#1              ;215
                  |L14.78|
00004e  42a1              CMP      r1,r4                 ;215
000050  dbf8              BLT      |L14.68|
;;;218      }
;;;219      /* We may be able to increment the count for one or more components without
;;;220       * exceeding max_colors, though we know not all can be incremented.
;;;221       * Sometimes, the first component can be incremented more than once!
;;;222       * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.)
;;;223       * In RGB colorspace, try to increment G first, then R, then B.
;;;224       */
;;;225      do {
;;;226        changed = FALSE;
;;;227        for (i = 0; i < nc; i++) {
;;;228          j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i);
000052  f8df9048          LDR      r9,|L14.156|
000056  bf00              NOP                            ;226
                  |L14.88|
000058  f04f0e00          MOV      lr,#0                 ;226
00005c  4671              MOV      r1,lr                 ;227
00005e  e016              B        |L14.142|
                  |L14.96|
000060  f8953029          LDRB     r3,[r5,#0x29]
000064  460a              MOV      r2,r1
000066  2b02              CMP      r3,#2
000068  d101              BNE      |L14.110|
00006a  f8592021          LDR      r2,[r9,r1,LSL #2]
                  |L14.110|
;;;229          /* calculate new total_colors if Ncolors[j] is incremented */
;;;230          temp = total_colors / Ncolors[j];
00006e  f8563022          LDR      r3,[r6,r2,LSL #2]
000072  fb90fcf3          SDIV     r12,r0,r3
;;;231          temp *= Ncolors[j]+1;	/* done in long arith to avoid oflo */
000076  1c5b              ADDS     r3,r3,#1
000078  4698              MOV      r8,r3
00007a  fb03f30c          MUL      r3,r3,r12
;;;232          if (temp > (long) max_colors)
00007e  42bb              CMP      r3,r7
000080  dc07              BGT      |L14.146|
;;;233    	break;			/* won't fit, done with this pass */
;;;234          Ncolors[j]++;		/* OK, apply the increment */
000082  f8468022          STR      r8,[r6,r2,LSL #2]
;;;235          total_colors = (int) temp;
000086  4618              MOV      r0,r3
;;;236          changed = TRUE;
000088  f04f0e01          MOV      lr,#1
00008c  1c49              ADDS     r1,r1,#1              ;227
                  |L14.142|
00008e  42a1              CMP      r1,r4                 ;227
000090  dbe6              BLT      |L14.96|
                  |L14.146|
;;;237        }
;;;238      } while (changed);
000092  f1be0f00          CMP      lr,#0
000096  d1df              BNE      |L14.88|
;;;239    
;;;240      return total_colors;
;;;241    }
000098  e8bd87f0          POP      {r4-r10,pc}
;;;242    
                          ENDP

                  |L14.156|
                          DCD      ||.constdata||+0x100

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

                  start_pass_1_quant PROC
;;;744    METHODDEF(void)
;;;745    start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;746    {
;;;747      my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
;;;748      size_t arraysize;
;;;749      int i;
;;;750    
;;;751      GUI_USE_PARA(is_pre_scan);
;;;752      /* Install my colormap. */
;;;753      cinfo->colormap = cquantize->sv_colormap;
000004  f8d041cc          LDR      r4,[r0,#0x1cc]
000008  f1000558          ADD      r5,r0,#0x58           ;746
00000c  6920              LDR      r0,[r4,#0x10]
;;;754      cinfo->actual_number_of_colors = cquantize->sv_actual;
00000e  6328              STR      r0,[r5,#0x30]
000010  6960              LDR      r0,[r4,#0x14]
;;;755    
;;;756      /* Initialize for desired dithering mode. */
;;;757      switch (cinfo->dither_mode) {
000012  62e8              STR      r0,[r5,#0x2c]
000014  f8150958          LDRB     r0,[r5],#-0x58
000018  b188              CBZ      r0,|L15.62|
00001a  2100              MOVS     r1,#0
00001c  2801              CMP      r0,#1
00001e  d017              BEQ      |L15.80|
000020  2802              CMP      r0,#2
000022  d136              BNE      |L15.146|
;;;758      case JDITHER_NONE:
;;;759        if (cinfo->out_color_components == 3)
;;;760          cquantize->pub.color_quantize = color_quantize3;
;;;761        else
;;;762          cquantize->pub.color_quantize = color_quantize;
;;;763        break;
;;;764      case JDITHER_ORDERED:
;;;765        if (cinfo->out_color_components == 3)
;;;766          cquantize->pub.color_quantize = quantize3_ord_dither;
;;;767        else
;;;768          cquantize->pub.color_quantize = quantize_ord_dither;
;;;769        cquantize->row_index = 0;	/* initialize state for ordered dither */
;;;770        /* If user changed to ordered dither from another mode,
;;;771         * we must recreate the color index table with padding.
;;;772         * This will cost extra space, but probably isn't very likely.
;;;773         */
;;;774        if (! cquantize->is_padded)
;;;775          create_colorindex(cinfo);
;;;776        /* Create ordered-dither tables if we didn't already. */
;;;777        if (cquantize->odither[0] == NULL)
;;;778          create_odither_tables(cinfo);
;;;779        break;
;;;780      case JDITHER_FS:
;;;781        cquantize->pub.color_quantize = quantize_fs_dither;
000024  481f              LDR      r0,|L15.164|
;;;782        cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */
;;;783        /* Allocate Floyd-Steinberg workspace if didn't already. */
;;;784        if (cquantize->fserrors[0] == NULL)
000026  6561              STR      r1,[r4,#0x54]
000028  6060              STR      r0,[r4,#4]
00002a  6c60              LDR      r0,[r4,#0x44]
00002c  b910              CBNZ     r0,|L15.52|
;;;785          alloc_fs_workspace(cinfo);
00002e  4628              MOV      r0,r5
000030  f7fffffe          BL       alloc_fs_workspace
                  |L15.52|
;;;786        /* Initialize the propagated errors to zero. */
;;;787        arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
000034  6f28              LDR      r0,[r5,#0x70]
;;;788        for (i = 0; i < cinfo->out_color_components; i++)
000036  2600              MOVS     r6,#0
000038  0047              LSLS     r7,r0,#1              ;787
00003a  1d3f              ADDS     r7,r7,#4              ;787
00003c  e025              B        |L15.138|
                  |L15.62|
00003e  6fa8              LDR      r0,[r5,#0x78]         ;759
000040  2803              CMP      r0,#3                 ;759
000042  d101              BNE      |L15.72|
000044  4818              LDR      r0,|L15.168|
000046  e000              B        |L15.74|
                  |L15.72|
0

⌨️ 快捷键说明

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