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

📄 qccentarithmeticmodel.3

📁 spiht for linux this is used to decod and encode vedio i wich all enjoy
💻 3
字号:
.TH QCCENTARITHMETICMODEL 3 "QCCPACK" "".SH NAMEQccENTArithmeticModel \- data structure .B QccENTArithmeticModelfor arithmetic encoding and decoding.SH SYNOPSIS.B #include "libQccPack.h".sp.BI "void QccENTArithmeticFreeModel(QccENTArithmeticModel *" model );.br.BI "int QccENTArithmeticSetModelContext(QccENTArithmeticModel *" model ", int " current_context );.br.BI "void QccENTArithmeticSetModelAdaption(QccENTArithmeticModel *" model ", int " adaptive );.br.BI "int QccENTArithmeticSetModelProbabilities(QccENTArithmeticModel *" model ", double *" probabilities ", int " context );.br.BI "int QccENTArithmeticResetModel(QccENTArithmeticModel *" model ", int " context );.SH DESCRIPTIONQccPack provides data structure.B QccENTArithmeticModelfor representing the arithmetic-coding model to use in arithmetic encoding anddecoding..LP.B CAVEAT:The.B QccENTArithmeticModeldata structure contains a number of variables and arrays which areused internally in the arithmetic encoding and decoding routines; thesevariables and arrays are described briefly below, but they should.I under no circumstancesbe accessed or modified by the user directly, as this will likelyresult in erroneous operation of the coder.Users who are interested in modifying the internal structureof the QccPack arithmetic-coder code should consult the paperby Witten et al. for details on the internal operation ofthe QccPack arithmetic coder anda thorough description of the variables and arrays internalto the.BR QccENTArithmeticModelstructure..SH "DATA STRUCTURE"The.B QccENTArithmeticModeldata structure is defined as:.RS.nftypedef struct{  int num_contexts;  int *num_symbols;  int **translate_symbol_to_index;  int **translate_index_to_symbol;  int **cumulative_frequencies;  int **frequencies;  QccENTCodeValue low, high;  long bits_to_follow;  int garbage_bits;  int target_num_bits;  int adaptive_model;  QccENTArithmeticGetContext context_function;  int current_context;  QccENTCodeValue current_code_value;} QccENTArithmeticModel;.fi.RE.LPThe fields of.B QccENTArithmeticModelare as follows:.TP.I num_contextsThe total number of contexts..TP.I num_symbolsAn array of.I num_contextsentries, with each entryproviding the number of symbolsin the corresponding context..TP.IR translate_symbol_to_index ", " translate_index_to_symbol Internal arrays for translating between symbols and internal symbol indices.See Witten et al..TP.IR cumulative_frequencies ", " frequencies Together these arrays provide the probabilities andcumulative probabilities for the symbols in each context, expressedfor practical reasons as integer frequencies. SeeWitten et al..TP.IR low ", " high ", " bit_to_follow ", " current_code_valueInternal storage for the current code value and known range. SeeWitten et al..TP.IR target_num_bitsThe total number of desired bitsto be read by the arithmetic decoder; useful for decodingthe bitstream from packets with known sizes.A value of.B QCCENT_ANYNUMBITSindicates that there is no packet-length constraint; i.e., thedecoder reads symbols until it reaches the end of the bitstream orthe EOF symbol output by.BR QccENTArithmeticEncodeEnd (3)..TP.IR garbage_bitsThe number of bits the decoder has read beyond.I target_num_bits(or beyond the end of the file if.I target_num_bitsis.BR QCCENT_ANYNUMBITS )while attempting to decode the last symbol; needed since the decoder reads bits from the bitstream in advance of symbol output..TP.I adaptive_modelIndicates whether adaption in the model is currently turned on or off;i.e., whether the model is adaptive or nonadaptive.In an adaptive model, symbol frequency counts are updated each timea symbol is coded.In a nonadaptive model, symbol frequency counts arenot changed except through explicit setting of the frequency counts.Use.BR QccENTArithmeticSetModelAdaption (3)to change the state of adaption in the model, and.BR QccENTArithmeticSetModelProbabilities (3)to explicit chage frequency counts in a nonadaptive model.The model is initially created as an adaptive model..TP.I context_functionA function that returns the current context to be used in coding when.I num_contextsis greater than 1..I context_functioncan be .B NULLin which case the current context is retrieved from the.I current_contextfield of the model. See.BR QccENTArithmeticGetContext (3)..TP.I current_contextIf.I context_functionis .BR NULL ,the current context to be used in coding is retrieved from the.I current_contextfield of the arithmetic-model structure. User routines may set this fieldby calling.BR QccENTArithmeticSetModelContext (3)before calling routines such as.BR QccENTArithmeticEncode (3) and.BR QccENTArithmeticDecode (3)..SH "ROUTINES".BR QccENTArithmeticFreeModel()frees all the arrays contained in.IR model as well as .I modelitself..BR QccENTArithmeticFreeModel()should be called after.BR QccENTArithmeticEncodeEnd (3)or.BR QccENTArithmeticDecode (3)to get rid of the.B QccENTArithmeticModelstructure that has been used for encoding and decoding, whenone is done encoding or decoding..LP.BR QccENTArithmeticSetModelContext()sets the current-context field of.I modelto.IR current_context ..I current_contextmust be greater than or equal to zero, and less than orequal to.IR model->num_contexts ..BR QccENTArithmeticSetModelContext()returns 0 on success, or 1 if .I current_contextis an invalid context number..LP.BR QccENTArithmeticSetModelAdaption()changes the adaption state of the model. If.I adaptiveis.BR QCCENT_NONADAPTIVE ,the model is made nonadaptive; otherwise,if.I adaptiveis.BR QCCENT_ADAPTIVE ,the model becomes adaptive.The adaption mode of the model can be changed at any time during encoding,as long as the same changes to the adaption state are made duringdecoding as well.When.I modelis initially created, the model is set to be adaptive..LP.BR QccENTArithmeticSetModelProbabilities()can be use to manually set the frequency counts in a particular.I contextin a nonadaptive.I modelaccording to any desired probability distribution..I probabilitiesis a list of probability values, double-precision floating pointnumbers each greater than or equal to 0.0 and less than or equal to 1.0.There should be as many values in.I probabilitiesas there are symbols in.IR context (not including the EOF symbol automatically added to the contextduring the call to.BR QccENTArithmeticCreateModel (3);the frequency of the EOF symbol is set to automatically set to1 by.BR QccENTArithmeticSetModelProbabilities() ).Additionally, the probability values should form a validprobability mass function; i.e., they should sum to 1.0..BR QccENTArithmeticSetModelProbabilities()updates.I model->cumulative_frequenciesand.I model->frequenciesto approximate the distribution specified by.IR probabilities ..BR QccENTArithmeticSetModelProbabilities()returns in error if .I modelis not nonadaptive..LP.BR QccENTArithmeticResetModel()manually resets the frequency counts in a particular.I contextback to their initial values; i.e.,all frequency counts in the.I contextare set to 1. Unlike.BR QccENTArithmeticSetModelProbabilities() ,.I modelmay be either adaptive or nonadaptive..SH "SEE ALSO".BR QccENTArithmeticEncode (3),.BR QccENTArithmeticEncodeStart (3),.BR QccENTArithmeticEncodeEnd (3),.BR QccENTArithmeticDecode (3),.BR QccENTArithmeticDecodeStart (3),.BR QccENTArithmeticDecodeRestart (3),.BR QccENTArithmeticGetContext (3),.BR QccPackENT (3),.BR QccPack (3).LPI. H. Witten, R. M. Neal, and J. G. Cleary,"Arithmetic Coding for Data Compression,".IR "Communications of the ACM" ,vol. 30, no. 6, pp. 520-540, June 1987..SH AUTHORCopyright (C) 1997-2009  James E. Fowler.\"  The programs herein are free software; you can redistribute them an.or.\"  modify them under the terms of the GNU General Public License.\"  as published by the Free Software Foundation; either version 2.\"  of the License, or (at your option) any later version..\"  .\"  These programs are distributed in the hope that they will be useful,.\"  but WITHOUT ANY WARRANTY; without even the implied warranty of.\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the.\"  GNU General Public License for more details..\"  .\"  You should have received a copy of the GNU General Public License.\"  along with these programs; if not, write to the Free Software.\"  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

⌨️ 快捷键说明

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