亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? jcphuff.c

?? 一款最完整的工業組態軟源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
    }
    
    /* Find the number of bits needed for the magnitude of the coefficient */
    nbits = 0;
    while (temp) {
      nbits++;
      temp >>= 1;
    }
    /* Check for out-of-range coefficient values.
     * Since we're encoding a difference, the range limit is twice as much.
     */
    if (nbits > MAX_COEF_BITS+1)
      ERREXIT(cinfo, JERR_BAD_DCT_COEF);
    
    /* Count/emit the Huffman-coded symbol for the number of bits */
    emit_symbol(entropy, compptr->dc_tbl_no, nbits);
    
    /* Emit that number of bits of the value, if positive, */
    /* or the complement of its magnitude, if negative. */
    if (nbits)			/* emit_bits rejects calls with size 0 */
      emit_bits(entropy, (unsigned int) temp2, nbits);
  }

  cinfo->dest->next_output_byte = entropy->next_output_byte;
  cinfo->dest->free_in_buffer = entropy->free_in_buffer;

  /* Update restart-interval state too */
  if (cinfo->restart_interval) {
    if (entropy->restarts_to_go == 0) {
      entropy->restarts_to_go = cinfo->restart_interval;
      entropy->next_restart_num++;
      entropy->next_restart_num &= 7;
    }
    entropy->restarts_to_go--;
  }

  return TRUE;
}


/*
 * MCU encoding for AC initial scan (either spectral selection,
 * or first pass of successive approximation).
 */

METHODDEF(boolean)
encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  register int temp, temp2;
  register int nbits;
  register int r, k;
  int Se = cinfo->Se;
  int Al = cinfo->Al;
  JBLOCKROW block;

  entropy->next_output_byte = cinfo->dest->next_output_byte;
  entropy->free_in_buffer = cinfo->dest->free_in_buffer;

  /* Emit restart marker if needed */
  if (cinfo->restart_interval)
    if (entropy->restarts_to_go == 0)
      emit_restart(entropy, entropy->next_restart_num);

  /* Encode the MCU data block */
  block = MCU_data[0];

  /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */
  
  r = 0;			/* r = run length of zeros */
   
  for (k = cinfo->Ss; k <= Se; k++) {
    if ((temp = (*block)[jpeg_natural_order[k]]) == 0) {
      r++;
      continue;
    }
    /* We must apply the point transform by Al.  For AC coefficients this
     * is an integer division with rounding towards 0.  To do this portably
     * in C, we shift after obtaining the absolute value; so the code is
     * interwoven with finding the abs value (temp) and output bits (temp2).
     */
    if (temp < 0) {
      temp = -temp;		/* temp is abs value of input */
      temp >>= Al;		/* apply the point transform */
      /* For a negative coef, want temp2 = bitwise complement of abs(coef) */
      temp2 = ~temp;
    } else {
      temp >>= Al;		/* apply the point transform */
      temp2 = temp;
    }
    /* Watch out for case that nonzero coef is zero after point transform */
    if (temp == 0) {
      r++;
      continue;
    }

    /* Emit any pending EOBRUN */
    if (entropy->EOBRUN > 0)
      emit_eobrun(entropy);
    /* if run length > 15, must emit special run-length-16 codes (0xF0) */
    while (r > 15) {
      emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
      r -= 16;
    }

    /* Find the number of bits needed for the magnitude of the coefficient */
    nbits = 1;			/* there must be at least one 1 bit */
    while ((temp >>= 1))
      nbits++;
    /* Check for out-of-range coefficient values */
    if (nbits > MAX_COEF_BITS)
      ERREXIT(cinfo, JERR_BAD_DCT_COEF);

    /* Count/emit Huffman symbol for run length / number of bits */
    emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);

    /* Emit that number of bits of the value, if positive, */
    /* or the complement of its magnitude, if negative. */
    emit_bits(entropy, (unsigned int) temp2, nbits);

    r = 0;			/* reset zero run length */
  }

  if (r > 0) {			/* If there are trailing zeroes, */
    entropy->EOBRUN++;		/* count an EOB */
    if (entropy->EOBRUN == 0x7FFF)
      emit_eobrun(entropy);	/* force it out to avoid overflow */
  }

  cinfo->dest->next_output_byte = entropy->next_output_byte;
  cinfo->dest->free_in_buffer = entropy->free_in_buffer;

  /* Update restart-interval state too */
  if (cinfo->restart_interval) {
    if (entropy->restarts_to_go == 0) {
      entropy->restarts_to_go = cinfo->restart_interval;
      entropy->next_restart_num++;
      entropy->next_restart_num &= 7;
    }
    entropy->restarts_to_go--;
  }

  return TRUE;
}


/*
 * MCU encoding for DC successive approximation refinement scan.
 * Note: we assume such scans can be multi-component, although the spec
 * is not very clear on the point.
 */

METHODDEF(boolean)
encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  register int temp;
  int blkn;
  int Al = cinfo->Al;
  JBLOCKROW block;

  entropy->next_output_byte = cinfo->dest->next_output_byte;
  entropy->free_in_buffer = cinfo->dest->free_in_buffer;

  /* Emit restart marker if needed */
  if (cinfo->restart_interval)
    if (entropy->restarts_to_go == 0)
      emit_restart(entropy, entropy->next_restart_num);

  /* Encode the MCU data blocks */
  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
    block = MCU_data[blkn];

    /* We simply emit the Al'th bit of the DC coefficient value. */
    temp = (*block)[0];
    emit_bits(entropy, (unsigned int) (temp >> Al), 1);
  }

  cinfo->dest->next_output_byte = entropy->next_output_byte;
  cinfo->dest->free_in_buffer = entropy->free_in_buffer;

  /* Update restart-interval state too */
  if (cinfo->restart_interval) {
    if (entropy->restarts_to_go == 0) {
      entropy->restarts_to_go = cinfo->restart_interval;
      entropy->next_restart_num++;
      entropy->next_restart_num &= 7;
    }
    entropy->restarts_to_go--;
  }

  return TRUE;
}


/*
 * MCU encoding for AC successive approximation refinement scan.
 */

METHODDEF(boolean)
encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  register int temp;
  register int r, k;
  int EOB;
  char *BR_buffer;
  unsigned int BR;
  int Se = cinfo->Se;
  int Al = cinfo->Al;
  JBLOCKROW block;
  int absvalues[DCTSIZE2];

  entropy->next_output_byte = cinfo->dest->next_output_byte;
  entropy->free_in_buffer = cinfo->dest->free_in_buffer;

  /* Emit restart marker if needed */
  if (cinfo->restart_interval)
    if (entropy->restarts_to_go == 0)
      emit_restart(entropy, entropy->next_restart_num);

  /* Encode the MCU data block */
  block = MCU_data[0];

  /* It is convenient to make a pre-pass to determine the transformed
   * coefficients' absolute values and the EOB position.
   */
  EOB = 0;
  for (k = cinfo->Ss; k <= Se; k++) {
    temp = (*block)[jpeg_natural_order[k]];
    /* We must apply the point transform by Al.  For AC coefficients this
     * is an integer division with rounding towards 0.  To do this portably
     * in C, we shift after obtaining the absolute value.
     */
    if (temp < 0)
      temp = -temp;		/* temp is abs value of input */
    temp >>= Al;		/* apply the point transform */
    absvalues[k] = temp;	/* save abs value for main pass */
    if (temp == 1)
      EOB = k;			/* EOB = index of last newly-nonzero coef */
  }

  /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */
  
  r = 0;			/* r = run length of zeros */
  BR = 0;			/* BR = count of buffered bits added now */
  BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */

  for (k = cinfo->Ss; k <= Se; k++) {
    if ((temp = absvalues[k]) == 0) {
      r++;
      continue;
    }

    /* Emit any required ZRLs, but not if they can be folded into EOB */
    while (r > 15 && k <= EOB) {
      /* emit any pending EOBRUN and the BE correction bits */
      emit_eobrun(entropy);
      /* Emit ZRL */
      emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
      r -= 16;
      /* Emit buffered correction bits that must be associated with ZRL */
      emit_buffered_bits(entropy, BR_buffer, BR);
      BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
      BR = 0;
    }

    /* If the coef was previously nonzero, it only needs a correction bit.
     * NOTE: a straight translation of the spec's figure G.7 would suggest
     * that we also need to test r > 15.  But if r > 15, we can only get here
     * if k > EOB, which implies that this coefficient is not 1.
     */
    if (temp > 1) {
      /* The correction bit is the next bit of the absolute value. */
      BR_buffer[BR++] = (char) (temp & 1);
      continue;
    }

    /* Emit any pending EOBRUN and the BE correction bits */
    emit_eobrun(entropy);

    /* Count/emit Huffman symbol for run length / number of bits */
    emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);

    /* Emit output bit for newly-nonzero coef */
    temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1;
    emit_bits(entropy, (unsigned int) temp, 1);

    /* Emit buffered correction bits that must be associated with this code */
    emit_buffered_bits(entropy, BR_buffer, BR);
    BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
    BR = 0;
    r = 0;			/* reset zero run length */
  }

  if (r > 0 || BR > 0) {	/* If there are trailing zeroes, */
    entropy->EOBRUN++;		/* count an EOB */
    entropy->BE += BR;		/* concat my correction bits to older ones */
    /* We force out the EOB if we risk either:
     * 1. overflow of the EOB counter;
     * 2. overflow of the correction bit buffer during the next MCU.
     */
    if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))
      emit_eobrun(entropy);
  }

  cinfo->dest->next_output_byte = entropy->next_output_byte;
  cinfo->dest->free_in_buffer = entropy->free_in_buffer;

  /* Update restart-interval state too */
  if (cinfo->restart_interval) {
    if (entropy->restarts_to_go == 0) {
      entropy->restarts_to_go = cinfo->restart_interval;
      entropy->next_restart_num++;
      entropy->next_restart_num &= 7;
    }
    entropy->restarts_to_go--;
  }

  return TRUE;
}


/*
 * Finish up at the end of a Huffman-compressed progressive scan.
 */

METHODDEF(void)
finish_pass_phuff (j_compress_ptr cinfo)
{   
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;

  entropy->next_output_byte = cinfo->dest->next_output_byte;
  entropy->free_in_buffer = cinfo->dest->free_in_buffer;

  /* Flush out any buffered data */
  emit_eobrun(entropy);
  flush_bits(entropy);

  cinfo->dest->next_output_byte = entropy->next_output_byte;
  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
}


/*
 * Finish up a statistics-gathering pass and create the new Huffman tables.
 */

METHODDEF(void)
finish_pass_gather_phuff (j_compress_ptr cinfo)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  boolean is_DC_band;
  int ci, tbl;
  jpeg_component_info * compptr;
  JHUFF_TBL **htblptr;
  boolean did[NUM_HUFF_TBLS];

  /* Flush out buffered data (all we care about is counting the EOB symbol) */
  emit_eobrun(entropy);

  is_DC_band = (cinfo->Ss == 0);

  /* It's important not to apply jpeg_gen_optimal_table more than once
   * per table, because it clobbers the input frequency counts!
   */
  MEMZERO(did, SIZEOF(did));

  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
    compptr = cinfo->cur_comp_info[ci];
    if (is_DC_band) {
      if (cinfo->Ah != 0)	/* DC refinement needs no table */
	continue;
      tbl = compptr->dc_tbl_no;
    } else {
      tbl = compptr->ac_tbl_no;
    }
    if (! did[tbl]) {
      if (is_DC_band)
        htblptr = & cinfo->dc_huff_tbl_ptrs[tbl];
      else
        htblptr = & cinfo->ac_huff_tbl_ptrs[tbl];
      if (*htblptr == NULL)
        *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]);
      did[tbl] = TRUE;
    }
  }
}


/*
 * Module initialization routine for progressive Huffman entropy encoding.
 */

GLOBAL(void)
jinit_phuff_encoder (j_compress_ptr cinfo)
{
  phuff_entropy_ptr entropy;
  int i;

  entropy = (phuff_entropy_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(phuff_entropy_encoder));
  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
  entropy->pub.start_pass = start_pass_phuff;

  /* Mark tables unallocated */
  for (i = 0; i < NUM_HUFF_TBLS; i++) {
    entropy->derived_tbls[i] = NULL;
    entropy->count_ptrs[i] = NULL;
  }
  entropy->bit_buffer = NULL;	/* needed only in AC refinement scan */
}

#endif /* C_PROGRESSIVE_SUPPORTED */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99在线精品视频| 91精品一区二区三区在线观看| 日韩一区二区影院| 免费在线观看成人| 欧美大片拔萝卜| 国产一区二区网址| 国产精品三级av| 99re这里都是精品| 亚洲一区二三区| 欧美一区午夜视频在线观看| 精品一区二区三区免费视频| 国产人伦精品一区二区| 91美女片黄在线观看| 性做久久久久久久久| 欧美xxxxxxxx| 成人avav影音| 性做久久久久久| 国产午夜亚洲精品羞羞网站| 91视频观看视频| 蜜臀va亚洲va欧美va天堂| 国产午夜久久久久| 99久久久无码国产精品| 五月天亚洲婷婷| 国产日韩视频一区二区三区| 色婷婷久久综合| 蜜臀91精品一区二区三区 | 欧美性大战久久| 日本大胆欧美人术艺术动态| 欧美精品一区二区高清在线观看 | 日韩一级在线观看| 国产激情视频一区二区在线观看 | 精品日韩在线观看| 99久久夜色精品国产网站| 五月婷婷久久丁香| 久久久久成人黄色影片| 欧美午夜影院一区| 国产精一区二区三区| 亚洲综合999| 国产婷婷精品av在线| 欧美日韩国产成人在线91| 成人美女在线观看| 男女男精品网站| 亚洲永久免费视频| 国产天堂亚洲国产碰碰| 这里只有精品99re| 91福利精品视频| 成人av在线播放网站| 久久国产剧场电影| 五月婷婷综合激情| 亚洲精品视频免费看| 国产亚洲精品bt天堂精选| 欧美一区午夜视频在线观看| 色先锋资源久久综合| 91首页免费视频| 成a人片国产精品| 韩国成人福利片在线播放| 午夜影视日本亚洲欧洲精品| 亚洲色欲色欲www| 国产精品人人做人人爽人人添| 日韩免费性生活视频播放| 欧美日韩中文精品| av福利精品导航| 国产**成人网毛片九色| 精品一区二区三区不卡| 蜜桃精品在线观看| 亚洲成人一区二区在线观看| 一区二区视频在线| 最近中文字幕一区二区三区| 国产亚洲制服色| 欧美国产成人在线| 久久精品人人爽人人爽| 久久久青草青青国产亚洲免观| 日韩欧美成人激情| 精品少妇一区二区三区在线播放 | 色噜噜久久综合| 91丨porny丨蝌蚪视频| av激情亚洲男人天堂| av激情成人网| 日本丰满少妇一区二区三区| 色综合久久久久| 在线免费精品视频| 欧美久久久久久久久久 | 精品国产乱码久久久久久浪潮| 日韩欧美在线不卡| 欧美精品一区二区三区久久久| 26uuu国产在线精品一区二区| 亚洲精品一区二区三区影院| 精品日韩一区二区| 久久久精品影视| 国产精品国产三级国产普通话三级| 国产精品久久久久久久久快鸭 | 色综合天天综合网国产成人综合天 | 中文字幕一区二区三区av| 成人欧美一区二区三区视频网页| 中国av一区二区三区| 亚洲黄网站在线观看| 亚洲高清不卡在线| 麻豆国产精品一区二区三区| 久久av资源网| 99视频一区二区三区| 欧美四级电影在线观看| 日韩视频在线一区二区| 久久综合久久综合亚洲| 国产精品丝袜黑色高跟| 亚洲卡通动漫在线| 日本免费在线视频不卡一不卡二| 国产制服丝袜一区| 99v久久综合狠狠综合久久| 欧美精品一级二级| 国产午夜精品久久| 一区二区三区四区蜜桃| 另类小说综合欧美亚洲| 懂色av中文一区二区三区| 在线中文字幕不卡| 亚洲精品一线二线三线无人区| 欧美激情在线观看视频免费| 亚洲综合在线电影| 蜜臀av国产精品久久久久| 99久久综合精品| 日韩亚洲欧美一区| 国产精品久久久久久亚洲伦| 日韩影院免费视频| 99久久精品免费精品国产| 日韩一本二本av| 亚洲另类春色校园小说| 国产一区二区网址| 欧美日韩在线播放| 国产精品毛片久久久久久久| 天堂午夜影视日韩欧美一区二区| 国内精品伊人久久久久av影院 | 日韩—二三区免费观看av| 高清在线成人网| 91精品久久久久久久99蜜桃| 国产精品视频线看| 久久99国产乱子伦精品免费| 色诱亚洲精品久久久久久| 欧美成人精品福利| 亚洲自拍与偷拍| 91香蕉视频污在线| 久久久亚洲国产美女国产盗摄| 偷拍一区二区三区| 91成人国产精品| 国产精品美女久久久久久久久久久| 日韩高清在线一区| 欧美色综合天天久久综合精品| 久久理论电影网| 奇米影视一区二区三区| 欧美在线免费观看亚洲| 中日韩免费视频中文字幕| 国产精品自在在线| 欧美电影免费观看高清完整版在线 | 国产精品自产自拍| 欧美一区二区三区成人| 夜夜精品视频一区二区| 99久久99精品久久久久久| 久久久久久久久97黄色工厂| 精品中文字幕一区二区小辣椒| 欧美日韩精品一区二区三区蜜桃| 亚洲视频一区在线| 99re热这里只有精品免费视频| 国产亚洲女人久久久久毛片| 精品无人区卡一卡二卡三乱码免费卡| 欧美视频日韩视频在线观看| 夜夜嗨av一区二区三区网页| 一本久久a久久免费精品不卡| 国产日韩三级在线| jlzzjlzz亚洲日本少妇| 国产精品久久免费看| 成人短视频下载| 日韩一区有码在线| 色综合一区二区| 亚洲一本大道在线| 欧美日韩国产大片| 日韩精品成人一区二区三区| 欧美日本在线播放| 麻豆精品一区二区综合av| 日韩三区在线观看| 激情文学综合丁香| 国产视频一区在线播放| 丁香亚洲综合激情啪啪综合| 国产精品天干天干在观线| 99国内精品久久| 亚洲一区二区视频在线| 欧美日韩国产精选| 美女精品一区二区| 久久青草欧美一区二区三区| 国产a久久麻豆| 亚洲男人的天堂av| 欧美日韩久久久一区| 精品系列免费在线观看| 中文字幕制服丝袜成人av| 欧美性欧美巨大黑白大战| 免费高清在线视频一区·| 久久久美女毛片| 99久久久无码国产精品| 无码av中文一区二区三区桃花岛| 欧美mv和日韩mv的网站| 99re视频这里只有精品| 免费观看在线色综合| 中文字幕在线播放不卡一区|