ComponentOne PdfViewer for WPF and Silverlight
C1.WPF.PdfViewer.4.6.2 Assembly / CSJ2K.j2k.entropy.encoder Namespace / MQCoder Class / codeSymbols Method
An array containing the symbols to be encoded. Valid symbols are 0 and 1.
The context for each of the symbols to be encoded.
The number of symbols to encode.

In This Topic
    codeSymbols Method
    In This Topic
    This function performs the arithmetic encoding of several symbols together. The function receives an array of symbols that are to be encoded and an array containing the contexts with which to encode them.

    The advantage of using this function is that the cost of the method call is amortized by the number of coded symbols per method call.

    Each context has a current MPS and an index describing what the current probability is for the LPS. Each bit is encoded and if the probability of the LPS exceeds .5, the MPS and LPS are switched.

    Syntax
    'Declaration
     
    
    Public Sub codeSymbols( _
       ByVal bits() As Integer, _
       ByVal cX() As Integer, _
       ByVal n As Integer _
    ) 
    public void codeSymbols( 
       int[] bits,
       int[] cX,
       int n
    )

    Parameters

    bits
    An array containing the symbols to be encoded. Valid symbols are 0 and 1.
    cX
    The context for each of the symbols to be encoded.
    n
    The number of symbols to encode.
    See Also