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

📄 klttce3d_lossless.c

📁 spiht for linux this is used to decod and encode vedio i wich all enjoy
💻 C
📖 第 1 页 / 共 5 页
字号:
                      else                        {                          if (QccENTArithmeticDecode(buffer,model,&symbol, 1))                            {                              return_value = 2;                              goto Return;                            }                          else                            return_value = 0;                                            if (symbol)                            coefficients->volume[current_frame][current_row][current_col] =                              threshold + (threshold >> 1);                        }                      v = symbol;	                                      if (symbol)                        {//c                          subband_significance[subband]++;                          scale += increment;                          *p_char = QCCWAVKLTTCE3D_S_NEW;                                            if (QccWAVTce3DUpdateModel(model, 0.5))                            {                              QccErrorAddMessage("(QccWAVklttce3DIntIPBand): Error calling QccWAVklttceUpdateModel()");                              goto Error;                            }                                            if (buffer->type == QCCBITBUFFER_OUTPUT)                            {                              symbol = (int)(sign_array[current_frame][current_row][current_col]);                              return_value =                                QccENTArithmeticEncode(&symbol, 1,model, buffer);                                  }                          else                            {                              if (QccENTArithmeticDecode(buffer,model,&symbol, 1))                                return_value = 2;                                    sign_array[current_frame][current_row][current_col] = (char)symbol;                            }                          QccWAV3DUpdateNZNStatus(subband_origin_frame,                                                  subband_origin_row,                                                  subband_origin_col,                                                  subband_num_frames,                                                  subband_num_rows,                                                  subband_num_cols,                                                  frame,                                                  row,                                                  col,                                                  significance_map,                                                  subband);                        }//c                                        if (return_value == 2)                        goto Return;                      else                        {                          if (return_value)                            {                              QccErrorAddMessage("(QccWAVklttce3DIntIPBand): QccWAVklttceIPBand()");                              goto Error;                            }                        }                       if (col == 0)                        p1[row][col] = alpha * p_forward  + filter_coef * v;                      else                        p1[row][col] = alpha * p1[row][col-1] + filter_coef * v;                      p2[col] = p1[row][col] + alpha * p2[col];                     }//a                  else                    {                       if (col == 0)                        p1[row][col] = alpha *p_forward   + filter_coef * QCCWAVKLTTCE3D_REFINE_HOLDER;                      else                        p1[row][col] = alpha* p1[row][col-1] + filter_coef * QCCWAVKLTTCE3D_REFINE_HOLDER;                      p2[col] = p1[row][col] + alpha * p2[col];                     }                  p_estimation[subband_origin_frame+frame][subband_origin_row + row][subband_origin_col + col] =                    p_forward;                }//aa              for (col = subband_num_cols - 1; col >= 0; col--)                {                    if (col ==( subband_num_cols - 1))                     p2[col] = p2[col] + alpha * p_estimation[subband_origin_frame+frame][subband_origin_row +row][subband_origin_col + col];                  else                    p2[col] = p2[col] + alpha * p4[row][col+1];                  p3[row][col]=p2[col]+alpha*p3[row][col];                  p_char = &(significance_map[current_frame][current_row][subband_origin_col + col]);                  if (*p_char == QCCWAVKLTTCE3D_S)                    {                      if (col == (subband_num_cols - 1))                        p4[row][col] = alpha * p_estimation[subband_origin_frame+frame][subband_origin_row +row][subband_origin_col + col] + filter_coef * QCCWAVKLTTCE3D_REFINE_HOLDER;                       else                         p4[row][col] = alpha * p4[row][col+1] + filter_coef * QCCWAVKLTTCE3D_REFINE_HOLDER;;                    }                   else                    {                      v = (*p_char == QCCWAVKLTTCE3D_S_NEW);                      if (col == subband_num_cols - 1)                        p4[row][col]  = alpha * p_estimation[subband_origin_frame+frame][subband_origin_row +row][subband_origin_col + col] + filter_coef * v;                      else                        p4[row][col] = alpha * p4[row][col+1] + filter_coef * v;                    }                }            }//aaa	           for (col = 0; col < subband_num_cols; col++)            p5[col]=p_estimation[current_frame][subband_origin_row +subband_num_rows - 1][subband_origin_col+col];	             for (row = subband_num_rows - 1; row >= 0; row--)            {              for (col = 0; col < subband_num_cols; col++)                {		  p3[row][col]=p3[row][col]+alpha*p5[col];                  if (col ==( subband_num_cols - 1))		    p5[col]=p1[row][col]+alpha*p5[col]+alpha*p_estimation[subband_origin_frame+frame][subband_origin_row +row][subband_origin_col + col] ;                  else                     p5[col]=p1[row][col]+alpha*p5[col]+alpha*p4[row][col+1];                }            }        }    }//aaaa       for (frame = subband_num_frames-1;frame >= 0; frame--)    {//bbb      current_frame=subband_origin_frame+frame;      if ((threshold - 0.000001) <          pow((double)2, (double)max_coefficient_bits[subband][frame]))        {          for (row = subband_num_rows - 1; row >= 0; row--)            {//bb                     current_row = subband_origin_row + row;              for (col = subband_num_cols-1; col >=0; col--)                {                     current_col = subband_origin_col + col;                   p_char = &(significance_map[current_frame][current_row][current_col]);                  if (col ==( subband_num_cols-1) )                    p_estimation[current_frame][current_row][current_col]+=alpha * (p_estimation[subband_origin_frame+frame][subband_origin_row +row][subband_origin_col + col] + p2[col] + p3[row][col]);                  else                    p_estimation[current_frame][current_row][current_col] +=alpha *(p1[row][col+1]+p2[col]+p3[row][col]);                                   if (*p_char == QCCWAVKLTTCE3D_S)                    {                      p_estimation[current_frame][current_row][current_col]=                        QCCWAVKLTTCE3D_REFINE_HOLDER * weight[0] +                        p_estimation[current_frame][current_row][current_col] * weight[1];                      if (col == (subband_num_cols-1) )                        p1[row][col] = alpha * p_estimation[subband_origin_frame+frame][subband_origin_row +row][subband_origin_col + col] + filter_coef * QCCWAVKLTTCE3D_REFINE_HOLDER;                      else                          p1[row][col] = alpha * p1[row][col+1] + filter_coef * QCCWAVKLTTCE3D_REFINE_HOLDER;                    }                  else                    {                      v = (*p_char == QCCWAVKLTTCE3D_S_NEW);                      p_estimation[current_frame][current_row][current_col] =                        v * weight[0] +p_estimation[current_frame][current_row][current_col] * weight[1];                      if (col == (subband_num_cols-1) )                        p1[row][col] = alpha * p_estimation[subband_origin_frame+frame][subband_origin_row +row][subband_origin_col + col]  + filter_coef * v;                      else                        p1[row][col] = alpha * p1[row][col+1] + filter_coef * v;                    }                      p2[col] = p1[row][col] + alpha * p2[col];                   }                        for (col = 0; col < subband_num_cols; col++)                {                  if(col==0)                    p2[col] = p2[col] + alpha * p_estimation[subband_origin_frame+frame][subband_origin_row +row][subband_origin_col + col];                  else                    p2[col] = p2[col] + alpha * p4[row][col-1];                  current_col = subband_origin_col + col;                   p_char = &(significance_map[current_frame][current_row][current_col]);                  if (*p_char == QCCWAVKLTTCE3D_S)                    {                      if(col==0)                        p4[row][col] = alpha * p_estimation[subband_origin_frame+frame][subband_origin_row +row][subband_origin_col + col] + filter_coef * QCCWAVKLTTCE3D_REFINE_HOLDER;                      else                         p4[row][col] = alpha * p4[row][col-1] + filter_coef * QCCWAVKLTTCE3D_REFINE_HOLDER;                    }                  else                    {                      v = (*p_char == QCCWAVKLTTCE3D_S_NEW);		      if(col==0)		        p4[row][col] = alpha * p_estimation[subband_origin_frame+frame][subband_origin_row +row][subband_origin_col + col] + filter_coef * v;	 	      else 		        p4[row][col] = alpha * p4[row][col-1] + filter_coef *v;                    }                        }            }//bb          for (row = 0; row < subband_num_rows; row++)            for (col = 0; col < subband_num_cols; col++)	      {		p3[row][col]=p3[row][col]+alpha*p5[col];                if(col==0)		  p5[col]=p1[row][col]+alpha*p5[col]+alpha* p_estimation[subband_origin_frame+frame][subband_origin_row +row][subband_origin_col + col];                 else                  p5[col]=p1[row][col]+alpha*p5[col]+alpha*p4[row][col-1];	      }        }    }//bbb    return_value = 0;  goto Return; Error:  return_value = 1; Return:   QccVectorFree(p2);   QccVectorFree(p5);  QccMatrixFree(p1,subband_num_rows);   QccMatrixFree(p3,subband_num_rows);   QccMatrixFree(p4,subband_num_rows);   return(return_value); }static int QccWAVklttce3DIntIPPass(QccWAVSubbandPyramid3DInt *coefficients,                                       char ***significance_map,                                   char ***sign_array,                                   int threshold,                                   double ***p_estimation,                                   double *subband_significance,                                   QccENTArithmeticModel *model,                                   QccBitBuffer *buffer,                                   int **max_coefficient_bits,                                   double alpha){  int subband,num_subbands;   int return_value;  num_subbands =    QccWAVSubbandPyramid3DIntNumLevelsToNumSubbandsPacket(coefficients->temporal_num_levels,                                                          coefficients->spatial_num_levels);      for (subband = 0; subband < num_subbands; subband++)    {      {        return_value =          QccWAVklttce3DIntRevEst(coefficients,                                  significance_map,                                  subband,                                  subband_significance,                                  p_estimation,                                  alpha);        if (return_value == 1)          {            QccErrorAddMessage("(QccWAVklttce3DIntIPPass): Error calling QccWAVklttce3DIntRevEst()");            return(1);          }        else          {            if (return_value == 2)              return(2);          }                  return_value = QccWAVklttce3DIntIPBand(coefficients,                                               significance_map,                                               sign_array,                                               p_estimation,                                               subband_significance,                                               subband,                                               threshold,                                               model,                                               buffer,                                               alpha,max_coefficient_bits);        if (return_value == 1)          {            QccErrorAddMessage("(QccWAVklttce3DIntIPPass): Error calling QccWAVklttce3DIntIPBand()");            return(1);          }        else          {            if (return_value == 2)              return(2);          }      }    }   return(0);}int static QccWAVklttce3DIntSPass(QccWAVSubbandPyramid3DInt *coefficients,                                      char ***significance_map,                                  int threshold,                                  QccENTArithmeticModel *model,                                  QccBitBuffer *buffer,                                  int **max_coefficient_bits){    int subband,num_subbands;   int return_value;  int subband_origin_frame;  int subband_origin_row;  int subband_origin_col;  int subband_num_frames;  int subband_num_rows;  int subband_num_cols;  int frame,row, col;  int current_frame,current_row, current_col;  char *p_char;  int symbol;  double p = 0.4;  num_subbands =    QccWAVSubbandPyramid3DIntNumLevelsToNumSubbandsPacket(coefficients->temporal_num_levels,                                                          coefficients->spatial_num_levels);   for (subband = 0; subband < num_subbands; subband++)    {      if (QccWAVSubbandPyramid3DIntSubbandSize(coefficients,                                               subband,                                               &subband_num_frames,                                               &subband_num_rows,                                               &subband_num_cols))        {          QccErrorAddMessage("(QccWAVklttce3DIntSPass): Error calling QccWAVSubbandPyramid3DIntSubbandSize(()");          return(1);        }      if (QccWAVSubbandPyramid3DIntSubbandOffsets(coefficients,                                                  subband,                                                  &subband_origin_fram

⌨️ 快捷键说明

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