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

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

?? block_encoder.cpp.bak

?? 這是我剛剛完成的關于JPEG2000的C語言實現的部分程序。小波變換是采用97變換
?? BAK
?? 第 1 頁 / 共 5 頁
字號:
/******************************************************************************Description:   Implements the embedded block coding algorithm, including distortionestimation and R-D covex hull analysis, in addition to the codingpasses themselves.  The low level services offered by the MQ arithmetic coderappear in "mq_encoder.cpp" and "mq_encoder.h".******************************************************************************/#include <math.h>#include <string.h>#include "kdu_messaging.h"#include "kdu_block_coding.h"#include "block_coding_common.h"#include "mq_encoder.h"static kdu_byte *significance_luts[4] =  {lh_sig_lut, hl_sig_lut, lh_sig_lut, hh_sig_lut};#define DISTORTION_LSBS 5#define SIGNIFICANCE_DISTORTIONS (1<<DISTORTION_LSBS)#define REFINEMENT_DISTORTIONS (1<<(DISTORTION_LSBS+1))static kdu_int32 significance_distortion_lut[SIGNIFICANCE_DISTORTIONS];static kdu_int32 significance_distortion_lut_lossless[SIGNIFICANCE_DISTORTIONS];static kdu_int32 refinement_distortion_lut[REFINEMENT_DISTORTIONS];static kdu_int32 refinement_distortion_lut_lossless[REFINEMENT_DISTORTIONS];#define EXTRA_ENCODE_CWORDS 3 // Number of extra context-words between stripes.#define MAX_POSSIBLE_PASSES (31*3-2)/* ========================================================================= *//*                   Local Class and Structure Definitions                   *//* ========================================================================= *//*****************************************************************************//*                             kd_block_encoder                              *//*****************************************************************************/class kd_block_encoder : public kdu_block_encoder_base {  /* Although we can supply a constructor and a virtual destructor in the     future, we have no need for these for the moment. */  protected:    void encode(kdu_block *block, bool reversible, double msb_wmse,                kdu_uint16 estimated_slope_threshold);  private: // Internal implementation    void reset_states()      { // See Table 12.1 in the book by Taubman and Marcellin        for (int n=0; n < 18; n++)          states[n].init(0,0);        states[KAPPA_SIG_BASE].init(4,0);        states[KAPPA_RUN_BASE].init(3,0);      }  private: // Data    mqe_state states[18];  };/* ========================================================================= *//*            Initialization of Distortion Estimation Tables                 *//* ========================================================================= */static void initialize_significance_distortion_luts();static void initialize_refinement_distortion_luts();static class encoder_local_init {    public: encoder_local_init()              { initialize_significance_distortion_luts();                initialize_refinement_distortion_luts(); }  } _do_it;/*****************************************************************************//* STATIC          initialize_significance_distortion_luts                   *//*****************************************************************************/static void  initialize_significance_distortion_luts(){  double fp_scale = (double)(1<<16);  for (kdu_int32 n=0; n < SIGNIFICANCE_DISTORTIONS; n++)    {      kdu_int32 idx = n | (1<<DISTORTION_LSBS);      double v_tilde = ((double) idx) / ((double)(1<<DISTORTION_LSBS));      assert((v_tilde >= 1.0) && (v_tilde < 2.0));      double sqe_before = v_tilde*v_tilde;      double sqe_after = (v_tilde-1.5)*(v_tilde-1.5);      significance_distortion_lut[n] = (int)        floor(0.5 + fp_scale*(sqe_before-sqe_after));      significance_distortion_lut_lossless[n] = (int)        floor(0.5 + fp_scale*sqe_before);    }}/*****************************************************************************//* STATIC            initialize_refinement_distortion_luts                   *//*****************************************************************************/static void  initialize_refinement_distortion_luts(){  double fp_scale = (double)(1<<16);  for (kdu_int32 n=0; n < REFINEMENT_DISTORTIONS; n++)    {      double v_tilde = ((double) n) / ((double)(1<<DISTORTION_LSBS));      assert(v_tilde < 2.0);      double sqe_before = (v_tilde-1.0)*(v_tilde-1.0);      v_tilde = (n >> DISTORTION_LSBS)?(v_tilde-1.0):v_tilde;      assert((v_tilde >= 0.0) && (v_tilde < 1.0));      double sqe_after = (v_tilde-0.5)*(v_tilde-0.5);      refinement_distortion_lut[n] = (int)        floor(0.5 + fp_scale*(sqe_before-sqe_after));      refinement_distortion_lut_lossless[n] = (int)        floor(0.5 + fp_scale*sqe_before);    }}/* ========================================================================= *//*             Binding of MQ and Raw Symbol Coding Services                  *//* ========================================================================= */#define USE_FAST_MACROS // Comment this out if you want functions instead.#ifdef USE_FAST_MACROS#  define _mq_check_out_(coder)                                     \     register kdu_int32 A; register kdu_int32 C; register kdu_int32 t; \     kdu_int32 temp; kdu_byte *store;                                 \     coder.check_out(A,C,t,temp,store)#  define _mq_check_in_(coder)                                      \     coder.check_in(A,C,t,temp,store)#  define _mq_enc_(coder,symbol,state)                              \     _mq_encode_(symbol,state,A,C,t,temp,store)#  define _mq_enc_run_(coder,run)                                   \     _mq_encode_run_(run,A,C,t,temp,store)#  define _raw_check_out_(coder)                                    \     register kdu_int32 t; register kdu_int32 temp; kdu_byte *store;   \     coder.check_out(t,temp,store)#  define _raw_check_in_(coder)                                     \     coder.check_in(t,temp,store)#  define _raw_enc_(coder,symbol)                                   \     _raw_encode_(symbol,t,temp,store)#else // Do not use fast macros#  define _mq_check_out_(coder)#  define _mq_check_in_(coder)#  define _mq_enc_(coder,symbol,state) coder.mq_encode(symbol,state)#  define _mq_enc_run_(coder,run) coder.mq_encode_run(run)#  define _raw_check_out_(coder)#  define _raw_check_in_(coder)#  define _raw_enc_(coder,symbol) coder.raw_encode(symbol)#endif // USE_FAST_MACROS /* The coding pass functions defined below all return a 32-bit integer,    which represents the normalized reduction in MSE associated with the    coded symbols.  Specifically, the MSE whose reduction is returned is    equal to 2^16 * sum_i (x_i/2^p - x_i_hat/2^p)^2 where x_i denotes the    integer sample values in the `samples' array and x_i_hat denotes the    quantized representation available from the current coding pass and all    previous coding passes, assuming a mid-point reconstruction rule.       The mid-point reconstruction rule satisfies x_i_hat = (q_i+1/2)*Delta    where q_i denotes the quantization indices and Delta is the quantization    step size.  This rule is modified only if the `lossless_pass' argument is    true, which is permitted only when symbols coded in the coding pass    result in a lossless representation of the corresponding subband samples.    Of course, this can only happen in the last bit-plane when the reversible    compression path is being used.  In this case, the function uses the fact    that all coded symbols have 0 distortion.       It should be noted that the MSE reduction can be negative, meaning    that the coding of symbols actually increases distortion. *//* ========================================================================= *//*                           Coding pass functions                           *//* ========================================================================= *//*****************************************************************************//* STATIC                   encode_sig_prop_pass_raw                         *//*****************************************************************************/static kdu_int32  encode_sig_prop_pass_raw(mq_encoder &coder, int p, bool causal,                           kdu_int32 *samples, kdu_int32 *contexts,                           int width, int num_stripes, int context_row_gap,                           bool lossless_pass){  /* Ideally, register storage is available for 9 32-bit integers. Two     are declared inside the "_raw_check_out_" macro.  The order of priority     for these registers corresponds roughly to the order in which their     declarations appear below.  Unfortunately, none of these register     requests are likely to be honored by the register-starved X86 family     of processors, but the register declarations may prove useful to     compilers for other architectures or for hand optimizations of     assembly code. */  register kdu_int32 *cp = contexts;  register int c;  register kdu_int32 cword;  _raw_check_out_(coder); // Declares t and temp as registers.  register kdu_int32 sym;  register kdu_int32 val;  register kdu_int32 *sp = samples;  register kdu_int32 shift = 31-p; assert(shift > 0);  int r, width_by2=width+width, width_by3=width_by2+width;  kdu_int32 distortion_change = 0;  kdu_int32 *distortion_lut = significance_distortion_lut;  if (lossless_pass)    distortion_lut = significance_distortion_lut_lossless;  assert((context_row_gap - width) == EXTRA_ENCODE_CWORDS);  for (r=num_stripes; r > 0; r--, cp += EXTRA_ENCODE_CWORDS, sp += width_by3)    for (c=width; c > 0; c--, sp++, cp++)      {        if (*cp == 0)          continue;        cword = *cp;        if ((cword & (NBRHD_MASK<<0)) && !(cword & (SIG_PROP_MEMBER_MASK<<0)))          { // Process first row of stripe column (row 0)            val = sp[0]<<shift; // Move bit p to sign bit.            sym = (kdu_int32)(((kdu_uint32) val)>>31); // Move bit into LSB            _raw_enc_(coder,sym);            if (val >= 0) // New magnitude bit was 0, so still insignificant              { cword |= (PI_BIT<<0); goto row_1; }            // Compute distortion change            val =  (val>>(31-DISTORTION_LSBS)) & (SIGNIFICANCE_DISTORTIONS-1);            distortion_change += distortion_lut[val];            // Encode sign bit            sym = sp[0];            sym = (kdu_int32)(((kdu_uint32) sym)>>31); // Move sign into LSB            _raw_enc_(coder,sym);            // Broadcast neighbourhood context changes            if (!causal)              {                cp[-context_row_gap-1] |=(SIGMA_BR_BIT<<9);                cp[-context_row_gap  ] |=(SIGMA_BC_BIT<<9)|(sym<<NEXT_CHI_POS);                cp[-context_row_gap+1] |=(SIGMA_BL_BIT<<9);              }            cp[-1] |= (SIGMA_CR_BIT<<0);            cp[1]  |= (SIGMA_CL_BIT<<0);            cword |= (SIGMA_CC_BIT<<0) | (PI_BIT<<0) | (sym<<CHI_POS);          }row_1:        if ((cword & (NBRHD_MASK<<3)) && !(cword & (SIG_PROP_MEMBER_MASK<<3)))          { // Process second row of stripe column (row 1)            val = sp[width]<<shift; // Move bit p to sign bit.            sym = (kdu_int32)(((kdu_uint32) val)>>31); // Move bit into LSB            _raw_enc_(coder,sym);            if (val >= 0) // New magnitude bit was 0, so still insignificant              { cword |= (PI_BIT<<3); goto row_2; }            // Compute distortion change            val =  (val>>(31-DISTORTION_LSBS)) & (SIGNIFICANCE_DISTORTIONS-1);            distortion_change += distortion_lut[val];            // Encode sign bit            sym = sp[width];            sym = (kdu_int32)(((kdu_uint32) sym)>>31); // Move sign into LSB            _raw_enc_(coder,sym);            // Broadcast neighbourhood context changes            cp[-1] |= (SIGMA_CR_BIT<<3);            cp[1]  |= (SIGMA_CL_BIT<<3);            cword |= (SIGMA_CC_BIT<<3) | (PI_BIT<<3) | (sym<<(CHI_POS+3));          }row_2:        if ((cword & (NBRHD_MASK<<6)) && !(cword & (SIG_PROP_MEMBER_MASK<<6)))          { // Process third row of stripe column (row 2)            val = sp[width_by2]<<shift; // Move bit p to sign bit.            sym = (kdu_int32)(((kdu_uint32) val)>>31); // Move bit into LSB            _raw_enc_(coder,sym);            if (val >= 0) // New magnitude bit was 0, so still insignificant              { cword |= (PI_BIT<<6); goto row_3; }            // Compute distortion change            val =  (val>>(31-DISTORTION_LSBS)) & (SIGNIFICANCE_DISTORTIONS-1);            distortion_change += distortion_lut[val];            // Encode sign bit            sym = sp[width_by2];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产秦先生| 7777精品伊人久久久大香线蕉的| 亚洲v精品v日韩v欧美v专区 | 亚洲高清免费观看高清完整版在线观看 | 伊人色综合久久天天人手人婷| 欧美激情中文不卡| 国产日韩欧美制服另类| 久久九九99视频| 久久九九99视频| 亚洲欧美一区二区视频| 亚洲日本欧美天堂| 亚洲国产视频一区| 日本不卡一二三区黄网| 国产一区啦啦啦在线观看| 国产精品资源在线看| 懂色av一区二区在线播放| av一区二区不卡| 一本色道亚洲精品aⅴ| 欧美三级三级三级| 日韩一区二区三区视频| 久久久久成人黄色影片| 一区在线播放视频| 婷婷综合久久一区二区三区| 另类综合日韩欧美亚洲| 国产成人精品一区二区三区四区 | 欧美图片一区二区三区| 91麻豆精品国产| 国产欧美精品一区二区色综合朱莉| 国产精品看片你懂得| 亚洲欧美日韩国产一区二区三区 | 久久精品网站免费观看| 中文字幕日韩欧美一区二区三区| 一区二区三区小说| 日韩av电影免费观看高清完整版| 国精产品一区一区三区mba视频| www.日韩精品| 欧美电影免费观看完整版| 中文字幕巨乱亚洲| 日韩vs国产vs欧美| 91最新地址在线播放| 日韩一区二区三区在线观看| 日本一区二区三区dvd视频在线 | 精品国产91洋老外米糕| 中文字幕亚洲在| 捆绑调教一区二区三区| 色综合久久九月婷婷色综合| 精品乱码亚洲一区二区不卡| 亚洲一级二级在线| 成a人片亚洲日本久久| 欧美日韩国产一级| 亚洲特级片在线| 国产乱子伦视频一区二区三区| 欧美日韩五月天| 亚洲欧洲色图综合| 国产精品一区二区在线观看网站| 欧美日产国产精品| 亚洲精品综合在线| 不卡的电影网站| 精品国产在天天线2019| 日日噜噜夜夜狠狠视频欧美人| 99精品视频一区二区| 国产三级精品三级在线专区| 捆绑调教美女网站视频一区| 欧美日韩三级在线| 亚洲一区电影777| 色婷婷精品久久二区二区蜜臀av| 欧美国产日韩亚洲一区| 国产在线一区观看| 精品国产91洋老外米糕| 经典一区二区三区| 欧美sm极限捆绑bd| 精品一区二区在线播放| 欧美一级免费大片| 天天综合天天做天天综合| 欧美日韩国产精品成人| 亚洲成人精品在线观看| 欧美影院精品一区| 亚洲成va人在线观看| 在线看日韩精品电影| 亚洲一二三级电影| 欧美人妇做爰xxxⅹ性高电影| 亚洲高清在线视频| 日韩三级在线观看| 国产在线不卡一区| 国产精品欧美一区二区三区| www.欧美亚洲| 亚洲小少妇裸体bbw| 欧美一区二区福利在线| 久久国内精品视频| 国产女同性恋一区二区| zzijzzij亚洲日本少妇熟睡| 亚洲精品免费电影| 在线不卡a资源高清| 精品亚洲porn| 中文无字幕一区二区三区| 99久久综合精品| 亚洲一区在线视频| 欧美xxxx在线观看| 国产成人综合网| 一二三区精品视频| 日韩一区二区在线看片| 国产精品一级二级三级| 亚洲精品免费在线播放| 日韩视频永久免费| av电影在线不卡| 性做久久久久久免费观看| 久久综合久久鬼色| 91国偷自产一区二区开放时间| 日韩综合在线视频| 亚洲欧洲精品一区二区三区不卡| 欧美日韩国产区一| 国产成人av在线影院| 亚洲成a天堂v人片| 国产精品第13页| 日韩一级片网址| 91香蕉视频mp4| 精品亚洲国产成人av制服丝袜| 亚洲欧美综合另类在线卡通| 日韩一级大片在线| 日本国产一区二区| 国产精品亚洲午夜一区二区三区| 亚洲精品欧美专区| 国产精品视频麻豆| 日韩欧美国产一区在线观看| 色悠悠亚洲一区二区| 国产精品911| 欧美a级理论片| 亚洲主播在线播放| 成人免费在线观看入口| 2024国产精品| 日韩欧美成人一区二区| 日本久久电影网| 成人avav影音| 国产高清在线观看免费不卡| 日本不卡不码高清免费观看| 伊人一区二区三区| 亚洲日本护士毛茸茸| 国产精品久久久久一区二区三区 | 免费欧美在线视频| 亚洲午夜激情av| 亚洲激情成人在线| 中文字幕在线观看不卡视频| 久久免费精品国产久精品久久久久| 欧美精品一卡二卡| 欧美日韩在线三级| 欧美日韩美女一区二区| 色综合天天视频在线观看| 成人理论电影网| 成人天堂资源www在线| 国产99一区视频免费| 国产成a人无v码亚洲福利| 国内国产精品久久| 麻豆视频观看网址久久| 久久精品免费观看| 精品在线一区二区三区| 国产在线精品视频| 成人午夜激情视频| 成人高清免费观看| 99re这里只有精品首页| 色综合久久久网| 在线视频一区二区三| 在线观看视频一区| 7777精品伊人久久久大香线蕉的 | 国产精品久久久久久久久久免费看 | 久久成人18免费观看| 久久精品国产**网站演员| 国内精品久久久久影院色| 精品一区二区三区在线播放视频| 精品一区二区三区日韩| 国产黄人亚洲片| 91美女在线观看| 欧美二区乱c少妇| 精品国产百合女同互慰| 中文字幕免费观看一区| 亚洲免费在线观看视频| 三级欧美韩日大片在线看| 久久精品国产一区二区| 成人一区二区三区在线观看| 91天堂素人约啪| 欧美一区二区三区日韩视频| 久久影院视频免费| 一区二区欧美国产| 美女视频一区二区三区| 懂色av中文一区二区三区| 欧美自拍偷拍一区| 精品国产伦一区二区三区免费| 国产精品丝袜91| 全国精品久久少妇| av在线播放不卡| 欧美一区二区精品在线| 亚洲色图在线看| 久久成人久久鬼色| 欧美手机在线视频| 久久蜜桃一区二区| 亚洲午夜激情网页| 成人美女视频在线观看18| 91精品国产色综合久久不卡蜜臀 | 成人av在线资源网站| 欧美电影在线免费观看| 国产精品久久午夜夜伦鲁鲁|