signature:
public class FLVReader { /** * Searching for the next tag in a file after corrupt segment
 * @ return
 * @ throws IOException */
public boolean repositionFile ( ) throws IOException { } }

implementation: int payloadSize = 0 ; for ( int i = 0 ; i < REPOSITION_BUFFER_READS ; i ++ ) { while ( readBuf . hasRemaining ( ) ) { payloadSize = ( ( payloadSize & 0xffff ) << 8 ) | ( readBuf . get ( ) & 0xff ) ; int pointerPos = readBuf . position ( ) + 7 + payloadSize ; if ( readBuf . position ( ) >= 8 && pointerPos < readBuf . limit ( ) - 4 && readBuf . getInt ( pointerPos ) - payloadSize == 11 ) { readBuf . position ( readBuf . position ( ) - 8 ) ; return true ; } } initialRead ( ch ) ; if ( ! readBuf . hasRemaining ( ) ) break ; } return false ;


signature:
public class FfmpegIntDct { /** * / * furthermore , we scale the results by 2PASS1 _ BITS . */
private final static void pass1 ( ShortBuffer data ) { } }

implementation:
int z1 ; int tmp2 ; int tmp3 ; int tmp0 ; int tmp1 ; int tmp10 ; int tmp13 ; int tmp11 ; int tmp12 ; int z2 ; int z3 ; int z4 ; int z5 ; ShortBuffer dataptr = data . duplicate ( ) ; for ( int rowctr = DCTSIZE - 1 ; rowctr >= 0 ; rowctr -- ) { /* * Due to quantization , we will usually find that many of the input
 * coefficients are zero , especially the AC terms . We can exploit
 * this by short - circuiting the IDCT calculation for any row in
 * which all the AC terms are zero . In that case each output is
 * equal to the DC coefficient ( with scale factor as needed ) . With
 * typical images and quantization tables , half or more of the row
 * DCT calculations can be simplified this way . */
// register int * idataptr = ( int * ) dataptr ;
/* * WARNING : we do the same permutation as MMX idct to simplify the
 * video core */
int d0 = dataptr . get ( 0 ) ; int d2 = dataptr . get ( 1 ) ; int d4 = dataptr . get ( 2 ) ; int d6 = dataptr . get ( 3 ) ; int d1 = dataptr . get ( 4 ) ; int d3 = dataptr . get ( 5 ) ; int d5 = dataptr . get ( 6 ) ; int d7 = dataptr . get ( 7 ) ; if ( ( d1 | d2 | d3 | d4 | d5 | d6 | d7 ) == 0 ) { /* AC terms all zero */
if ( d0 != 0 ) { /* Compute a 32 bit value to assign . */
int dcval = ( int ) ( d0 << PASS1_BITS ) ; for ( int i = 0 ; i < 8 ; i ++ ) { dataptr . put ( i , ( short ) dcval ) ; } } /* * advance pointer to next row */
dataptr = advance ( dataptr , DCTSIZE ) ; continue ; } /* Even part : reverse the even part of the forward DCT . */
/* The rotator is sqrt ( 2 ) c ( - 6 ) . */
if ( d6 != 0 ) { if ( d2 != 0 ) { /* d0 ! = 0 , d2 ! = 0 , d4 ! = 0 , d6 ! = 0 */
z1 = MULTIPLY ( d2 + d6 , FIX_0_541196100 ) ; tmp2 = z1 + MULTIPLY ( - d6 , FIX_1_847759065 ) ; tmp3 = z1 + MULTIPLY ( d2 , FIX_0_765366865 ) ; tmp0 = ( d0 + d4 ) << CONST_BITS ; tmp1 = ( d0 - d4 ) << CONST_BITS ; tmp10 = tmp0 + tmp3 ; tmp13 = tmp0 - tmp3 ; tmp11 = tmp1 + tmp2 ; tmp12 = tmp1 - tmp2 ; } else { /* d0 ! = 0 , d2 = = 0 , d4 ! = 0 , d6 ! = 0 */
tmp2 = MULTIPLY ( - d6 , FIX_1_306562965 ) ; tmp3 = MULTIPLY ( d6 , FIX_0_541196100 ) ; tmp0 = ( d0 + d4 ) << CONST_BITS ; tmp1 = ( d0 - d4 ) << CONST_BITS ; tmp10 = tmp0 + tmp3 ; tmp13 = tmp0 - tmp3 ; tmp11 = tmp1 + tmp2 ; tmp12 = tmp1 - tmp2 ; } } else { if ( d2 != 0 ) { /* d0 ! = 0 , d2 ! = 0 , d4 ! = 0 , d6 = = 0 */
tmp2 = MULTIPLY ( d2 , FIX_0_541196100 ) ; tmp3 = MULTIPLY ( d2 , FIX_1_306562965 ) ; tmp0 = ( d0 + d4 ) << CONST_BITS ; tmp1 = ( d0 - d4 ) << CONST_BITS ; tmp10 = tmp0 + tmp3 ; tmp13 = tmp0 - tmp3 ; tmp11 = tmp1 + tmp2 ; tmp12 = tmp1 - tmp2 ; } else { /* d0 ! = 0 , d2 = = 0 , d4 ! = 0 , d6 = = 0 */
tmp10 = tmp13 = ( d0 + d4 ) << CONST_BITS ; tmp11 = tmp12 = ( d0 - d4 ) << CONST_BITS ; } } /* * Odd part per figure 8 ; the matrix is unitary and hence its
 * transpose is its inverse . i0 . . i3 are y7 , y5 , y3 , y1 respectively . */
if ( d7 != 0 ) { if ( d5 != 0 ) { if ( d3 != 0 ) { if ( d1 != 0 ) { /* d1 ! = 0 , d3 ! = 0 , d5 ! = 0 , d7 ! = 0 */
z1 = d7 + d1 ; z2 = d5 + d3 ; z3 = d7 + d3 ; z4 = d5 + d1 ; z5 = MULTIPLY ( z3 + z4 , FIX_1_175875602 ) ; tmp0 = MULTIPLY ( d7 , FIX_0_298631336 ) ; tmp1 = MULTIPLY ( d5 , FIX_2_053119869 ) ; tmp2 = MULTIPLY ( d3 , FIX_3_072711026 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_501321110 ) ; z1 = MULTIPLY ( - z1 , FIX_0_899976223 ) ; z2 = MULTIPLY ( - z2 , FIX_2_562915447 ) ; z3 = MULTIPLY ( - z3 , FIX_1_961570560 ) ; z4 = MULTIPLY ( - z4 , FIX_0_390180644 ) ; z3 += z5 ; z4 += z5 ; tmp0 += z1 + z3 ; tmp1 += z2 + z4 ; tmp2 += z2 + z3 ; tmp3 += z1 + z4 ; } else { /* d1 = = 0 , d3 ! = 0 , d5 ! = 0 , d7 ! = 0 */
z2 = d5 + d3 ; z3 = d7 + d3 ; z5 = MULTIPLY ( z3 + d5 , FIX_1_175875602 ) ; tmp0 = MULTIPLY ( d7 , FIX_0_298631336 ) ; tmp1 = MULTIPLY ( d5 , FIX_2_053119869 ) ; tmp2 = MULTIPLY ( d3 , FIX_3_072711026 ) ; z1 = MULTIPLY ( - d7 , FIX_0_899976223 ) ; z2 = MULTIPLY ( - z2 , FIX_2_562915447 ) ; z3 = MULTIPLY ( - z3 , FIX_1_961570560 ) ; z4 = MULTIPLY ( - d5 , FIX_0_390180644 ) ; z3 += z5 ; z4 += z5 ; tmp0 += z1 + z3 ; tmp1 += z2 + z4 ; tmp2 += z2 + z3 ; tmp3 = z1 + z4 ; } } else { if ( d1 != 0 ) { /* d1 ! = 0 , d3 = = 0 , d5 ! = 0 , d7 ! = 0 */
z1 = d7 + d1 ; z4 = d5 + d1 ; z5 = MULTIPLY ( d7 + z4 , FIX_1_175875602 ) ; tmp0 = MULTIPLY ( d7 , FIX_0_298631336 ) ; tmp1 = MULTIPLY ( d5 , FIX_2_053119869 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_501321110 ) ; z1 = MULTIPLY ( - z1 , FIX_0_899976223 ) ; z2 = MULTIPLY ( - d5 , FIX_2_562915447 ) ; z3 = MULTIPLY ( - d7 , FIX_1_961570560 ) ; z4 = MULTIPLY ( - z4 , FIX_0_390180644 ) ; z3 += z5 ; z4 += z5 ; tmp0 += z1 + z3 ; tmp1 += z2 + z4 ; tmp2 = z2 + z3 ; tmp3 += z1 + z4 ; } else { /* d1 = = 0 , d3 = = 0 , d5 ! = 0 , d7 ! = 0 */
tmp0 = MULTIPLY ( - d7 , FIX_0_601344887 ) ; z1 = MULTIPLY ( - d7 , FIX_0_899976223 ) ; z3 = MULTIPLY ( - d7 , FIX_1_961570560 ) ; tmp1 = MULTIPLY ( - d5 , FIX_0_509795579 ) ; z2 = MULTIPLY ( - d5 , FIX_2_562915447 ) ; z4 = MULTIPLY ( - d5 , FIX_0_390180644 ) ; z5 = MULTIPLY ( d5 + d7 , FIX_1_175875602 ) ; z3 += z5 ; z4 += z5 ; tmp0 += z3 ; tmp1 += z4 ; tmp2 = z2 + z3 ; tmp3 = z1 + z4 ; } } } else { if ( d3 != 0 ) { if ( d1 != 0 ) { /* d1 ! = 0 , d3 ! = 0 , d5 = = 0 , d7 ! = 0 */
z1 = d7 + d1 ; z3 = d7 + d3 ; z5 = MULTIPLY ( z3 + d1 , FIX_1_175875602 ) ; tmp0 = MULTIPLY ( d7 , FIX_0_298631336 ) ; tmp2 = MULTIPLY ( d3 , FIX_3_072711026 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_501321110 ) ; z1 = MULTIPLY ( - z1 , FIX_0_899976223 ) ; z2 = MULTIPLY ( - d3 , FIX_2_562915447 ) ; z3 = MULTIPLY ( - z3 , FIX_1_961570560 ) ; z4 = MULTIPLY ( - d1 , FIX_0_390180644 ) ; z3 += z5 ; z4 += z5 ; tmp0 += z1 + z3 ; tmp1 = z2 + z4 ; tmp2 += z2 + z3 ; tmp3 += z1 + z4 ; } else { /* d1 = = 0 , d3 ! = 0 , d5 = = 0 , d7 ! = 0 */
z3 = d7 + d3 ; tmp0 = MULTIPLY ( - d7 , FIX_0_601344887 ) ; z1 = MULTIPLY ( - d7 , FIX_0_899976223 ) ; tmp2 = MULTIPLY ( d3 , FIX_0_509795579 ) ; z2 = MULTIPLY ( - d3 , FIX_2_562915447 ) ; z5 = MULTIPLY ( z3 , FIX_1_175875602 ) ; z3 = MULTIPLY ( - z3 , FIX_0_785694958 ) ; tmp0 += z3 ; tmp1 = z2 + z5 ; tmp2 += z3 ; tmp3 = z1 + z5 ; } } else { if ( d1 != 0 ) { /* d1 ! = 0 , d3 = = 0 , d5 = = 0 , d7 ! = 0 */
z1 = d7 + d1 ; z5 = MULTIPLY ( z1 , FIX_1_175875602 ) ; z1 = MULTIPLY ( z1 , FIX_0_275899380 ) ; z3 = MULTIPLY ( - d7 , FIX_1_961570560 ) ; tmp0 = MULTIPLY ( - d7 , FIX_1_662939225 ) ; z4 = MULTIPLY ( - d1 , FIX_0_390180644 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_111140466 ) ; tmp0 += z1 ; tmp1 = z4 + z5 ; tmp2 = z3 + z5 ; tmp3 += z1 ; } else { /* d1 = = 0 , d3 = = 0 , d5 = = 0 , d7 ! = 0 */
tmp0 = MULTIPLY ( - d7 , FIX_1_387039845 ) ; tmp1 = MULTIPLY ( d7 , FIX_1_175875602 ) ; tmp2 = MULTIPLY ( - d7 , FIX_0_785694958 ) ; tmp3 = MULTIPLY ( d7 , FIX_0_275899380 ) ; } } } } else { if ( d5 != 0 ) { if ( d3 != 0 ) { if ( d1 != 0 ) { /* d1 ! = 0 , d3 ! = 0 , d5 ! = 0 , d7 = = 0 */
z2 = d5 + d3 ; z4 = d5 + d1 ; z5 = MULTIPLY ( d3 + z4 , FIX_1_175875602 ) ; tmp1 = MULTIPLY ( d5 , FIX_2_053119869 ) ; tmp2 = MULTIPLY ( d3 , FIX_3_072711026 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_501321110 ) ; z1 = MULTIPLY ( - d1 , FIX_0_899976223 ) ; z2 = MULTIPLY ( - z2 , FIX_2_562915447 ) ; z3 = MULTIPLY ( - d3 , FIX_1_961570560 ) ; z4 = MULTIPLY ( - z4 , FIX_0_390180644 ) ; z3 += z5 ; z4 += z5 ; tmp0 = z1 + z3 ; tmp1 += z2 + z4 ; tmp2 += z2 + z3 ; tmp3 += z1 + z4 ; } else { /* d1 = = 0 , d3 ! = 0 , d5 ! = 0 , d7 = = 0 */
z2 = d5 + d3 ; z5 = MULTIPLY ( z2 , FIX_1_175875602 ) ; tmp1 = MULTIPLY ( d5 , FIX_1_662939225 ) ; z4 = MULTIPLY ( - d5 , FIX_0_390180644 ) ; z2 = MULTIPLY ( - z2 , FIX_1_387039845 ) ; tmp2 = MULTIPLY ( d3 , FIX_1_111140466 ) ; z3 = MULTIPLY ( - d3 , FIX_1_961570560 ) ; tmp0 = z3 + z5 ; tmp1 += z2 ; tmp2 += z2 ; tmp3 = z4 + z5 ; } } else { if ( d1 != 0 ) { /* d1 ! = 0 , d3 = = 0 , d5 ! = 0 , d7 = = 0 */
z4 = d5 + d1 ; z5 = MULTIPLY ( z4 , FIX_1_175875602 ) ; z1 = MULTIPLY ( - d1 , FIX_0_899976223 ) ; tmp3 = MULTIPLY ( d1 , FIX_0_601344887 ) ; tmp1 = MULTIPLY ( - d5 , FIX_0_509795579 ) ; z2 = MULTIPLY ( - d5 , FIX_2_562915447 ) ; z4 = MULTIPLY ( z4 , FIX_0_785694958 ) ; tmp0 = z1 + z5 ; tmp1 += z4 ; tmp2 = z2 + z5 ; tmp3 += z4 ; } else { /* d1 = = 0 , d3 = = 0 , d5 ! = 0 , d7 = = 0 */
tmp0 = MULTIPLY ( d5 , FIX_1_175875602 ) ; tmp1 = MULTIPLY ( d5 , FIX_0_275899380 ) ; tmp2 = MULTIPLY ( - d5 , FIX_1_387039845 ) ; tmp3 = MULTIPLY ( d5 , FIX_0_785694958 ) ; } } } else { if ( d3 != 0 ) { if ( d1 != 0 ) { /* d1 ! = 0 , d3 ! = 0 , d5 = = 0 , d7 = = 0 */
z5 = d1 + d3 ; tmp3 = MULTIPLY ( d1 , FIX_0_211164243 ) ; tmp2 = MULTIPLY ( - d3 , FIX_1_451774981 ) ; z1 = MULTIPLY ( d1 , FIX_1_061594337 ) ; z2 = MULTIPLY ( - d3 , FIX_2_172734803 ) ; z4 = MULTIPLY ( z5 , FIX_0_785694958 ) ; z5 = MULTIPLY ( z5 , FIX_1_175875602 ) ; tmp0 = z1 - z4 ; tmp1 = z2 + z4 ; tmp2 += z5 ; tmp3 += z5 ; } else { /* d1 = = 0 , d3 ! = 0 , d5 = = 0 , d7 = = 0 */
tmp0 = MULTIPLY ( - d3 , FIX_0_785694958 ) ; tmp1 = MULTIPLY ( - d3 , FIX_1_387039845 ) ; tmp2 = MULTIPLY ( - d3 , FIX_0_275899380 ) ; tmp3 = MULTIPLY ( d3 , FIX_1_175875602 ) ; } } else { if ( d1 != 0 ) { /* d1 ! = 0 , d3 = = 0 , d5 = = 0 , d7 = = 0 */
tmp0 = MULTIPLY ( d1 , FIX_0_275899380 ) ; tmp1 = MULTIPLY ( d1 , FIX_0_785694958 ) ; tmp2 = MULTIPLY ( d1 , FIX_1_175875602 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_387039845 ) ; } else { /* d1 = = 0 , d3 = = 0 , d5 = = 0 , d7 = = 0 */
tmp0 = tmp1 = tmp2 = tmp3 = 0 ; } } } } /* Final output stage : inputs are tmp10 . . tmp13 , tmp0 . . tmp3 */
dataptr . put ( 0 , DESCALE11 ( tmp10 + tmp3 ) ) ; dataptr . put ( 7 , DESCALE11 ( tmp10 - tmp3 ) ) ; dataptr . put ( 1 , DESCALE11 ( tmp11 + tmp2 ) ) ; dataptr . put ( 6 , DESCALE11 ( tmp11 - tmp2 ) ) ; dataptr . put ( 2 , DESCALE11 ( tmp12 + tmp1 ) ) ; dataptr . put ( 5 , DESCALE11 ( tmp12 - tmp1 ) ) ; dataptr . put ( 3 , DESCALE11 ( tmp13 + tmp0 ) ) ; dataptr . put ( 4 , DESCALE11 ( tmp13 - tmp0 ) ) ; dataptr = advance ( dataptr , DCTSIZE ) ; /* advance pointer to next row */
}


signature:
public class FfmpegIntDct { /** * Perform the inverse DCT on one block of coefficients . */
private final static void pass2 ( ShortBuffer data ) { } }

implementation:
int tmp0 , tmp1 , tmp2 , tmp3 ; int tmp10 , tmp11 , tmp12 , tmp13 ; int z1 , z2 , z3 , z4 , z5 ; int d0 , d1 , d2 , d3 , d4 , d5 , d6 , d7 ; ShortBuffer dataptr = data . duplicate ( ) ; /* Pass 2 : process columns . */
/* Note that we must descale the results by a factor of 8 = = 23, */
/* and also undo the PASS1 _ BITS scaling . */
for ( int rowctr = DCTSIZE - 1 ; rowctr >= 0 ; rowctr -- ) { /* * Columns of zeroes can be exploited in the same way as we did with
 * rows . However , the row calculation has created many nonzero AC
 * terms , so the simplification applies less often ( typically 5 % to
 * 10 % of the time ) . On machines with very fast multiplication , it ' s
 * possible that the test takes more time than it ' s worth . In that
 * case this section may be commented out . */
d0 = dataptr . get ( DCTSIZE_0 ) ; d1 = dataptr . get ( DCTSIZE_1 ) ; d2 = dataptr . get ( DCTSIZE_2 ) ; d3 = dataptr . get ( DCTSIZE_3 ) ; d4 = dataptr . get ( DCTSIZE_4 ) ; d5 = dataptr . get ( DCTSIZE_5 ) ; d6 = dataptr . get ( DCTSIZE_6 ) ; d7 = dataptr . get ( DCTSIZE_7 ) ; /* Even part : reverse the even part of the forward DCT . */
/* The rotator is sqrt ( 2 ) c ( - 6 ) . */
if ( d6 != 0 ) { if ( d2 != 0 ) { /* d0 ! = 0 , d2 ! = 0 , d4 ! = 0 , d6 ! = 0 */
z1 = MULTIPLY ( d2 + d6 , FIX_0_541196100 ) ; tmp2 = z1 + MULTIPLY ( - d6 , FIX_1_847759065 ) ; tmp3 = z1 + MULTIPLY ( d2 , FIX_0_765366865 ) ; tmp0 = ( d0 + d4 ) << CONST_BITS ; tmp1 = ( d0 - d4 ) << CONST_BITS ; tmp10 = tmp0 + tmp3 ; tmp13 = tmp0 - tmp3 ; tmp11 = tmp1 + tmp2 ; tmp12 = tmp1 - tmp2 ; } else { /* d0 ! = 0 , d2 = = 0 , d4 ! = 0 , d6 ! = 0 */
tmp2 = MULTIPLY ( - d6 , FIX_1_306562965 ) ; tmp3 = MULTIPLY ( d6 , FIX_0_541196100 ) ; tmp0 = ( d0 + d4 ) << CONST_BITS ; tmp1 = ( d0 - d4 ) << CONST_BITS ; tmp10 = tmp0 + tmp3 ; tmp13 = tmp0 - tmp3 ; tmp11 = tmp1 + tmp2 ; tmp12 = tmp1 - tmp2 ; } } else { if ( d2 != 0 ) { /* d0 ! = 0 , d2 ! = 0 , d4 ! = 0 , d6 = = 0 */
tmp2 = MULTIPLY ( d2 , FIX_0_541196100 ) ; tmp3 = MULTIPLY ( d2 , FIX_1_306562965 ) ; tmp0 = ( d0 + d4 ) << CONST_BITS ; tmp1 = ( d0 - d4 ) << CONST_BITS ; tmp10 = tmp0 + tmp3 ; tmp13 = tmp0 - tmp3 ; tmp11 = tmp1 + tmp2 ; tmp12 = tmp1 - tmp2 ; } else { /* d0 ! = 0 , d2 = = 0 , d4 ! = 0 , d6 = = 0 */
tmp10 = tmp13 = ( d0 + d4 ) << CONST_BITS ; tmp11 = tmp12 = ( d0 - d4 ) << CONST_BITS ; } } /* * Odd part per figure 8 ; the matrix is unitary and hence its
 * transpose is its inverse . i0 . . i3 are y7 , y5 , y3 , y1 respectively . */
if ( d7 != 0 ) { if ( d5 != 0 ) { if ( d3 != 0 ) { if ( d1 != 0 ) { /* d1 ! = 0 , d3 ! = 0 , d5 ! = 0 , d7 ! = 0 */
z1 = d7 + d1 ; z2 = d5 + d3 ; z3 = d7 + d3 ; z4 = d5 + d1 ; z5 = MULTIPLY ( z3 + z4 , FIX_1_175875602 ) ; tmp0 = MULTIPLY ( d7 , FIX_0_298631336 ) ; tmp1 = MULTIPLY ( d5 , FIX_2_053119869 ) ; tmp2 = MULTIPLY ( d3 , FIX_3_072711026 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_501321110 ) ; z1 = MULTIPLY ( - z1 , FIX_0_899976223 ) ; z2 = MULTIPLY ( - z2 , FIX_2_562915447 ) ; z3 = MULTIPLY ( - z3 , FIX_1_961570560 ) ; z4 = MULTIPLY ( - z4 , FIX_0_390180644 ) ; z3 += z5 ; z4 += z5 ; tmp0 += z1 + z3 ; tmp1 += z2 + z4 ; tmp2 += z2 + z3 ; tmp3 += z1 + z4 ; } else { /* d1 = = 0 , d3 ! = 0 , d5 ! = 0 , d7 ! = 0 */
z1 = d7 ; z2 = d5 + d3 ; z3 = d7 + d3 ; z5 = MULTIPLY ( z3 + d5 , FIX_1_175875602 ) ; tmp0 = MULTIPLY ( d7 , FIX_0_298631336 ) ; tmp1 = MULTIPLY ( d5 , FIX_2_053119869 ) ; tmp2 = MULTIPLY ( d3 , FIX_3_072711026 ) ; z1 = MULTIPLY ( - d7 , FIX_0_899976223 ) ; z2 = MULTIPLY ( - z2 , FIX_2_562915447 ) ; z3 = MULTIPLY ( - z3 , FIX_1_961570560 ) ; z4 = MULTIPLY ( - d5 , FIX_0_390180644 ) ; z3 += z5 ; z4 += z5 ; tmp0 += z1 + z3 ; tmp1 += z2 + z4 ; tmp2 += z2 + z3 ; tmp3 = z1 + z4 ; } } else { if ( d1 != 0 ) { /* d1 ! = 0 , d3 = = 0 , d5 ! = 0 , d7 ! = 0 */
z1 = d7 + d1 ; z2 = d5 ; z3 = d7 ; z4 = d5 + d1 ; z5 = MULTIPLY ( z3 + z4 , FIX_1_175875602 ) ; tmp0 = MULTIPLY ( d7 , FIX_0_298631336 ) ; tmp1 = MULTIPLY ( d5 , FIX_2_053119869 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_501321110 ) ; z1 = MULTIPLY ( - z1 , FIX_0_899976223 ) ; z2 = MULTIPLY ( - d5 , FIX_2_562915447 ) ; z3 = MULTIPLY ( - d7 , FIX_1_961570560 ) ; z4 = MULTIPLY ( - z4 , FIX_0_390180644 ) ; z3 += z5 ; z4 += z5 ; tmp0 += z1 + z3 ; tmp1 += z2 + z4 ; tmp2 = z2 + z3 ; tmp3 += z1 + z4 ; } else { /* d1 = = 0 , d3 = = 0 , d5 ! = 0 , d7 ! = 0 */
tmp0 = MULTIPLY ( - d7 , FIX_0_601344887 ) ; z1 = MULTIPLY ( - d7 , FIX_0_899976223 ) ; z3 = MULTIPLY ( - d7 , FIX_1_961570560 ) ; tmp1 = MULTIPLY ( - d5 , FIX_0_509795579 ) ; z2 = MULTIPLY ( - d5 , FIX_2_562915447 ) ; z4 = MULTIPLY ( - d5 , FIX_0_390180644 ) ; z5 = MULTIPLY ( d5 + d7 , FIX_1_175875602 ) ; z3 += z5 ; z4 += z5 ; tmp0 += z3 ; tmp1 += z4 ; tmp2 = z2 + z3 ; tmp3 = z1 + z4 ; } } } else { if ( d3 != 0 ) { if ( d1 != 0 ) { /* d1 ! = 0 , d3 ! = 0 , d5 = = 0 , d7 ! = 0 */
z1 = d7 + d1 ; z3 = d7 + d3 ; z5 = MULTIPLY ( z3 + d1 , FIX_1_175875602 ) ; tmp0 = MULTIPLY ( d7 , FIX_0_298631336 ) ; tmp2 = MULTIPLY ( d3 , FIX_3_072711026 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_501321110 ) ; z1 = MULTIPLY ( - z1 , FIX_0_899976223 ) ; z2 = MULTIPLY ( - d3 , FIX_2_562915447 ) ; z3 = MULTIPLY ( - z3 , FIX_1_961570560 ) ; z4 = MULTIPLY ( - d1 , FIX_0_390180644 ) ; z3 += z5 ; z4 += z5 ; tmp0 += z1 + z3 ; tmp1 = z2 + z4 ; tmp2 += z2 + z3 ; tmp3 += z1 + z4 ; } else { /* d1 = = 0 , d3 ! = 0 , d5 = = 0 , d7 ! = 0 */
z3 = d7 + d3 ; tmp0 = MULTIPLY ( - d7 , FIX_0_601344887 ) ; z1 = MULTIPLY ( - d7 , FIX_0_899976223 ) ; tmp2 = MULTIPLY ( d3 , FIX_0_509795579 ) ; z2 = MULTIPLY ( - d3 , FIX_2_562915447 ) ; z5 = MULTIPLY ( z3 , FIX_1_175875602 ) ; z3 = MULTIPLY ( - z3 , FIX_0_785694958 ) ; tmp0 += z3 ; tmp1 = z2 + z5 ; tmp2 += z3 ; tmp3 = z1 + z5 ; } } else { if ( d1 != 0 ) { /* d1 ! = 0 , d3 = = 0 , d5 = = 0 , d7 ! = 0 */
z1 = d7 + d1 ; z5 = MULTIPLY ( z1 , FIX_1_175875602 ) ; z1 = MULTIPLY ( z1 , FIX_0_275899380 ) ; z3 = MULTIPLY ( - d7 , FIX_1_961570560 ) ; tmp0 = MULTIPLY ( - d7 , FIX_1_662939225 ) ; z4 = MULTIPLY ( - d1 , FIX_0_390180644 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_111140466 ) ; tmp0 += z1 ; tmp1 = z4 + z5 ; tmp2 = z3 + z5 ; tmp3 += z1 ; } else { /* d1 = = 0 , d3 = = 0 , d5 = = 0 , d7 ! = 0 */
tmp0 = MULTIPLY ( - d7 , FIX_1_387039845 ) ; tmp1 = MULTIPLY ( d7 , FIX_1_175875602 ) ; tmp2 = MULTIPLY ( - d7 , FIX_0_785694958 ) ; tmp3 = MULTIPLY ( d7 , FIX_0_275899380 ) ; } } } } else { if ( d5 != 0 ) { if ( d3 != 0 ) { if ( d1 != 0 ) { /* d1 ! = 0 , d3 ! = 0 , d5 ! = 0 , d7 = = 0 */
z2 = d5 + d3 ; z4 = d5 + d1 ; z5 = MULTIPLY ( d3 + z4 , FIX_1_175875602 ) ; tmp1 = MULTIPLY ( d5 , FIX_2_053119869 ) ; tmp2 = MULTIPLY ( d3 , FIX_3_072711026 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_501321110 ) ; z1 = MULTIPLY ( - d1 , FIX_0_899976223 ) ; z2 = MULTIPLY ( - z2 , FIX_2_562915447 ) ; z3 = MULTIPLY ( - d3 , FIX_1_961570560 ) ; z4 = MULTIPLY ( - z4 , FIX_0_390180644 ) ; z3 += z5 ; z4 += z5 ; tmp0 = z1 + z3 ; tmp1 += z2 + z4 ; tmp2 += z2 + z3 ; tmp3 += z1 + z4 ; } else { /* d1 = = 0 , d3 ! = 0 , d5 ! = 0 , d7 = = 0 */
z2 = d5 + d3 ; z5 = MULTIPLY ( z2 , FIX_1_175875602 ) ; tmp1 = MULTIPLY ( d5 , FIX_1_662939225 ) ; z4 = MULTIPLY ( - d5 , FIX_0_390180644 ) ; z2 = MULTIPLY ( - z2 , FIX_1_387039845 ) ; tmp2 = MULTIPLY ( d3 , FIX_1_111140466 ) ; z3 = MULTIPLY ( - d3 , FIX_1_961570560 ) ; tmp0 = z3 + z5 ; tmp1 += z2 ; tmp2 += z2 ; tmp3 = z4 + z5 ; } } else { if ( d1 != 0 ) { /* d1 ! = 0 , d3 = = 0 , d5 ! = 0 , d7 = = 0 */
z4 = d5 + d1 ; z5 = MULTIPLY ( z4 , FIX_1_175875602 ) ; z1 = MULTIPLY ( - d1 , FIX_0_899976223 ) ; tmp3 = MULTIPLY ( d1 , FIX_0_601344887 ) ; tmp1 = MULTIPLY ( - d5 , FIX_0_509795579 ) ; z2 = MULTIPLY ( - d5 , FIX_2_562915447 ) ; z4 = MULTIPLY ( z4 , FIX_0_785694958 ) ; tmp0 = z1 + z5 ; tmp1 += z4 ; tmp2 = z2 + z5 ; tmp3 += z4 ; } else { /* d1 = = 0 , d3 = = 0 , d5 ! = 0 , d7 = = 0 */
tmp0 = MULTIPLY ( d5 , FIX_1_175875602 ) ; tmp1 = MULTIPLY ( d5 , FIX_0_275899380 ) ; tmp2 = MULTIPLY ( - d5 , FIX_1_387039845 ) ; tmp3 = MULTIPLY ( d5 , FIX_0_785694958 ) ; } } } else { if ( d3 != 0 ) { if ( d1 != 0 ) { /* d1 ! = 0 , d3 ! = 0 , d5 = = 0 , d7 = = 0 */
z5 = d1 + d3 ; tmp3 = MULTIPLY ( d1 , FIX_0_211164243 ) ; tmp2 = MULTIPLY ( - d3 , FIX_1_451774981 ) ; z1 = MULTIPLY ( d1 , FIX_1_061594337 ) ; z2 = MULTIPLY ( - d3 , FIX_2_172734803 ) ; z4 = MULTIPLY ( z5 , FIX_0_785694958 ) ; z5 = MULTIPLY ( z5 , FIX_1_175875602 ) ; tmp0 = z1 - z4 ; tmp1 = z2 + z4 ; tmp2 += z5 ; tmp3 += z5 ; } else { /* d1 = = 0 , d3 ! = 0 , d5 = = 0 , d7 = = 0 */
tmp0 = MULTIPLY ( - d3 , FIX_0_785694958 ) ; tmp1 = MULTIPLY ( - d3 , FIX_1_387039845 ) ; tmp2 = MULTIPLY ( - d3 , FIX_0_275899380 ) ; tmp3 = MULTIPLY ( d3 , FIX_1_175875602 ) ; } } else { if ( d1 != 0 ) { /* d1 ! = 0 , d3 = = 0 , d5 = = 0 , d7 = = 0 */
tmp0 = MULTIPLY ( d1 , FIX_0_275899380 ) ; tmp1 = MULTIPLY ( d1 , FIX_0_785694958 ) ; tmp2 = MULTIPLY ( d1 , FIX_1_175875602 ) ; tmp3 = MULTIPLY ( d1 , FIX_1_387039845 ) ; } else { /* d1 = = 0 , d3 = = 0 , d5 = = 0 , d7 = = 0 */
tmp0 = tmp1 = tmp2 = tmp3 = 0 ; } } } } /* Final output stage : inputs are tmp10 . . tmp13 , tmp0 . . tmp3 */
dataptr . put ( DCTSIZE_0 , DESCALE18 ( tmp10 + tmp3 ) ) ; dataptr . put ( DCTSIZE_7 , DESCALE18 ( tmp10 - tmp3 ) ) ; dataptr . put ( DCTSIZE_1 , DESCALE18 ( tmp11 + tmp2 ) ) ; dataptr . put ( DCTSIZE_6 , DESCALE18 ( tmp11 - tmp2 ) ) ; dataptr . put ( DCTSIZE_2 , DESCALE18 ( tmp12 + tmp1 ) ) ; dataptr . put ( DCTSIZE_5 , DESCALE18 ( tmp12 - tmp1 ) ) ; dataptr . put ( DCTSIZE_3 , DESCALE18 ( tmp13 + tmp0 ) ) ; dataptr . put ( DCTSIZE_4 , DESCALE18 ( tmp13 - tmp0 ) ) ; dataptr = advance ( dataptr , 1 ) ; /* advance pointer to next column */
}


signature:
public class MDecoder { /** * Decodes one bin from arithmetice code word
 * @ param cm
 * @ return
 * @ throws IOException */
public int decodeBin ( int m ) { } }

implementation:
int bin ; int qIdx = ( range >> 6 ) & 0x3 ; int rLPS = MConst . rangeLPS [ qIdx ] [ cm [ 0 ] [ m ] ] ; range -= rLPS ; int rs8 = range << 8 ; if ( code < rs8 ) { // MPS
if ( cm [ 0 ] [ m ] < 62 ) cm [ 0 ] [ m ] ++ ; renormalize ( ) ; bin = cm [ 1 ] [ m ] ; } else { // LPS
range = rLPS ; code -= rs8 ; renormalize ( ) ; bin = 1 - cm [ 1 ] [ m ] ; if ( cm [ 0 ] [ m ] == 0 ) cm [ 1 ] [ m ] = 1 - cm [ 1 ] [ m ] ; cm [ 0 ] [ m ] = MConst . transitLPS [ cm [ 0 ] [ m ] ] ; } // System . out . println ( " CABAC BIT [ " + m + " ] : " + bin ) ;
return bin ;


signature:
public class MDecoder { /** * Special decoding process for symbols with uniform distribution
 * @ return
 * @ throws IOException */
public int decodeBinBypass ( ) { } }

implementation:
code <<= 1 ; -- nBitsPending ; if ( nBitsPending <= 0 ) readOneByte ( ) ; int tmp = code - ( range << 8 ) ; if ( tmp < 0 ) { // System . out . println ( " CABAC BIT [ - 1 ] : 0 " ) ;
return 0 ; } else { // System . out . println ( " CABAC BIT [ - 1 ] : 1 " ) ;
code = tmp ; return 1 ; }


signature:
public class MPEGUtil { /** * Finds next Nth MPEG bitstream marker 0x000001xx and returns the data that
 * preceeds it as a ByteBuffer slice
 * Segment byte order is always little endian
 * @ param buf
 * @ return */
public static final ByteBuffer gotoMarker ( ByteBuffer buf , int n , int mmin , int mmax ) { } }

implementation: if ( ! buf . hasRemaining ( ) ) return null ; int from = buf . position ( ) ; ByteBuffer result = buf . slice ( ) ; result . order ( ByteOrder . BIG_ENDIAN ) ; int val = 0xffffffff ; while ( buf . hasRemaining ( ) ) { val = ( val << 8 ) | ( buf . get ( ) & 0xff ) ; if ( val >= mmin && val <= mmax ) { if ( n == 0 ) { buf . position ( buf . position ( ) - 4 ) ; result . limit ( buf . position ( ) - from ) ; break ; } -- n ; } } return result ;


signature:
public class TFGrid { /** * / * first build into temp vector to be able to use previous vector on error */
public static int envelope_time_border_vector ( SBR sbr , int ch ) { } }

implementation:
int l , border , temp ; int [ ] t_E_temp = new int [ 6 ] ; t_E_temp [ 0 ] = sbr . rate * sbr . abs_bord_lead [ ch ] ; t_E_temp [ sbr . L_E [ ch ] ] = sbr . rate * sbr . abs_bord_trail [ ch ] ; switch ( sbr . bs_frame_class [ ch ] ) { case FIXFIX : switch ( sbr . L_E [ ch ] ) { case 4 : temp = ( sbr . numTimeSlots / 4 ) ; t_E_temp [ 3 ] = sbr . rate * 3 * temp ; t_E_temp [ 2 ] = sbr . rate * 2 * temp ; t_E_temp [ 1 ] = sbr . rate * temp ; break ; case 2 : t_E_temp [ 1 ] = sbr . rate * ( sbr . numTimeSlots / 2 ) ; break ; default : break ; } break ; case FIXVAR : if ( sbr . L_E [ ch ] > 1 ) { int i = sbr . L_E [ ch ] ; border = sbr . abs_bord_trail [ ch ] ; for ( l = 0 ; l < ( sbr . L_E [ ch ] - 1 ) ; l ++ ) { if ( border < sbr . bs_rel_bord [ ch ] [ l ] ) return 1 ; border -= sbr . bs_rel_bord [ ch ] [ l ] ; t_E_temp [ -- i ] = sbr . rate * border ; } } break ; case VARFIX : if ( sbr . L_E [ ch ] > 1 ) { int i = 1 ; border = sbr . abs_bord_lead [ ch ] ; for ( l = 0 ; l < ( sbr . L_E [ ch ] - 1 ) ; l ++ ) { border += sbr . bs_rel_bord [ ch ] [ l ] ; if ( sbr . rate * border + sbr . tHFAdj > sbr . numTimeSlotsRate + sbr . tHFGen ) return 1 ; t_E_temp [ i ++ ] = sbr . rate * border ; } } break ; case VARVAR : if ( sbr . bs_num_rel_0 [ ch ] != 0 ) { int i = 1 ; border = sbr . abs_bord_lead [ ch ] ; for ( l = 0 ; l < sbr . bs_num_rel_0 [ ch ] ; l ++ ) { border += sbr . bs_rel_bord_0 [ ch ] [ l ] ; if ( sbr . rate * border + sbr . tHFAdj > sbr . numTimeSlotsRate + sbr . tHFGen ) return 1 ; t_E_temp [ i ++ ] = sbr . rate * border ; } } if ( sbr . bs_num_rel_1 [ ch ] != 0 ) { int i = sbr . L_E [ ch ] ; border = sbr . abs_bord_trail [ ch ] ; for ( l = 0 ; l < sbr . bs_num_rel_1 [ ch ] ; l ++ ) { if ( border < sbr . bs_rel_bord_1 [ ch ] [ l ] ) return 1 ; border -= sbr . bs_rel_bord_1 [ ch ] [ l ] ; t_E_temp [ -- i ] = sbr . rate * border ; } } break ; } /* no error occured , we can safely use this t _ E vector */
for ( l = 0 ; l < 6 ; l ++ ) { sbr . t_E [ ch ] [ l ] = t_E_temp [ l ] ; } return 0 ;


signature:
public class PSFilterbank { /** * / * real filter , size 2 */
static void channel_filter2 ( int frame_len , float [ ] filter , float [ ] [ ] buffer , float [ ] [ ] [ ] X_hybrid ) { } }


signature:
public class PSFilterbank { /** * / * complex filter , size 4 */
static void channel_filter4 ( int frame_len , float [ ] filter , float [ ] [ ] buffer , float [ ] [ ] [ ] X_hybrid ) { } }


signature:
public class PSFilterbank { /** * / * complex filter , size 8 */
void channel_filter8 ( int frame_len , float [ ] filter , float [ ] [ ] buffer , float [ ] [ ] [ ] X_hybrid ) { } }


signature:
public class PSFilterbank { /** * / * complex filter , size 12 */
void channel_filter12 ( int frame_len , float [ ] filter , float [ ] [ ] buffer , float [ ] [ ] [ ] X_hybrid ) { } }

implementation: int i , n ; float [ ] input_re1 = new float [ 6 ] , input_re2 = new float [ 6 ] ; float [ ] input_im1 = new float [ 6 ] , input_im2 = new float [ 6 ] ; float [ ] out_re1 = new float [ 6 ] , out_re2 = new float [ 6 ] ; float [ ] out_im1 = new float [ 6 ] , out_im2 = new float [ 6 ] ; for ( i = 0 ; i < frame_len ; i ++ ) { for ( n = 0 ; n < 6 ; n ++ ) { if ( n == 0 ) { input_re1 [ 0 ] = ( buffer [ 6 + i ] [ 0 ] * filter [ 6 ] ) ; input_re2 [ 0 ] = ( buffer [ 6 + i ] [ 1 ] * filter [ 6 ] ) ; } else { input_re1 [ 6 - n ] = ( ( buffer [ n + i ] [ 0 ] + buffer [ 12 - n + i ] [ 0 ] ) * filter [ n ] ) ; input_re2 [ 6 - n ] = ( ( buffer [ n + i ] [ 1 ] + buffer [ 12 - n + i ] [ 1 ] ) * filter [ n ] ) ; } input_im2 [ n ] = ( ( buffer [ n + i ] [ 0 ] - buffer [ 12 - n + i ] [ 0 ] ) * filter [ n ] ) ; input_im1 [ n ] = ( ( buffer [ n + i ] [ 1 ] - buffer [ 12 - n + i ] [ 1 ] ) * filter [ n ] ) ; } DCT3_6_unscaled ( out_re1 , input_re1 ) ; DCT3_6_unscaled ( out_re2 , input_re2 ) ; DCT3_6_unscaled ( out_im1 , input_im1 ) ; DCT3_6_unscaled ( out_im2 , input_im2 ) ; for ( n = 0 ; n < 6 ; n += 2 ) { X_hybrid [ i ] [ n ] [ 0 ] = out_re1 [ n ] - out_im1 [ n ] ; X_hybrid [ i ] [ n ] [ 1 ] = out_re2 [ n ] + out_im2 [ n ] ; X_hybrid [ i ] [ n + 1 ] [ 0 ] = out_re1 [ n + 1 ] + out_im1 [ n + 1 ] ; X_hybrid [ i ] [ n + 1 ] [ 1 ] = out_re2 [ n + 1 ] - out_im2 [ n + 1 ] ; X_hybrid [ i ] [ 10 - n ] [ 0 ] = out_re1 [ n + 1 ] - out_im1 [ n + 1 ] ; X_hybrid [ i ] [ 10 - n ] [ 1 ] = out_re2 [ n + 1 ] + out_im2 [ n + 1 ] ; X_hybrid [ i ] [ 11 - n ] [ 0 ] = out_re1 [ n ] + out_im1 [ n ] ; X_hybrid [ i ] [ 11 - n ] [ 1 ] = out_re2 [ n ] - out_im2 [ n ] ; } }


signature:
public class PS { /** * / * read huffman data coded in either the frequency or the time direction */
private void huff_data ( IBitStream ld , boolean dt , int nr_par , int [ ] [ ] t_huff , int [ ] [ ] f_huff , int [ ] par ) throws AACException { } }

implementation:
int n ; if ( dt ) { /* coded in time direction */
for ( n = 0 ; n < nr_par ; n ++ ) { par [ n ] = ps_huff_dec ( ld , t_huff ) ; } } else { /* coded in frequency direction */
par [ 0 ] = ps_huff_dec ( ld , f_huff ) ; for ( n = 1 ; n < nr_par ; n ++ ) { par [ n ] = ps_huff_dec ( ld , f_huff ) ; } }


signature:
public class PS { /** * / * binary search huffman decoding */
private int ps_huff_dec ( IBitStream ld , int [ ] [ ] t_huff ) throws AACException { } }

implementation: int bit ; int index = 0 ; while ( index >= 0 ) { bit = ld . readBit ( ) ; index = t_huff [ index ] [ bit ] ; } return index + 31 ;


signature:
public class PS { /** * / * limits the value i to the range [ min , max ] */
private int delta_clip ( int i , int min , int max ) { } }

implementation: if ( i < min ) return min ; else if ( i > max ) return max ; else return i ;


signature:
public class PS { /** * / * delta decode array */
private void delta_decode ( boolean enable , int [ ] index , int [ ] index_prev , boolean dt_flag , int nr_par , int stride , int min_index , int max_index ) { } }

implementation:
int i ; if ( enable ) { if ( ! dt_flag ) { /* delta coded in frequency direction */
index [ 0 ] = 0 + index [ 0 ] ; index [ 0 ] = delta_clip ( index [ 0 ] , min_index , max_index ) ; for ( i = 1 ; i < nr_par ; i ++ ) { index [ i ] = index [ i - 1 ] + index [ i ] ; index [ i ] = delta_clip ( index [ i ] , min_index , max_index ) ; } } else { /* delta coded in time direction */
for ( i = 0 ; i < nr_par ; i ++ ) { // int8 _ t tmp2;
// int8 _ t tmp = index [ i ] ;
// printf ( " % d % d \ n " , index _ prev [ i * stride ] , index [ i ] ) ;
// printf ( " % d \ n " , index [ i ] ) ;
index [ i ] = index_prev [ i * stride ] + index [ i ] ; // tmp2 = index [ i ] ;
index [ i ] = delta_clip ( index [ i ] , min_index , max_index ) ; // if ( iid )
// if ( index [ i ] = = 7)
// printf ( " % d % d % d \ n " , index _ prev [ i * stride ] , tmp , tmp2 ) ;
} } } else { /* set indices to zero */
for ( i = 0 ; i < nr_par ; i ++ ) { index [ i ] = 0 ; } } /* coarse */
if ( stride == 2 ) { for ( i = ( nr_par << 1 ) - 1 ; i > 0 ; i -- ) { index [ i ] = index [ i >> 1 ] ; } }


signature:
public class PS { /** * / * in : log2 value of the modulo value to allow using AND instead of MOD */
private void delta_modulo_decode ( boolean enable , int [ ] index , int [ ] index_prev , boolean dt_flag , int nr_par , int stride , int and_modulo ) { } }

implementation:
int i ; if ( enable ) { if ( ! dt_flag ) { /* delta coded in frequency direction */
index [ 0 ] = 0 + index [ 0 ] ; index [ 0 ] &= and_modulo ; for ( i = 1 ; i < nr_par ; i ++ ) { index [ i ] = index [ i - 1 ] + index [ i ] ; index [ i ] &= and_modulo ; } } else { /* delta coded in time direction */
for ( i = 0 ; i < nr_par ; i ++ ) { index [ i ] = index_prev [ i * stride ] + index [ i ] ; index [ i ] &= and_modulo ; } } } else { /* set indices to zero */
for ( i = 0 ; i < nr_par ; i ++ ) { index [ i ] = 0 ; } } /* coarse */
if ( stride == 2 ) { index [ 0 ] = 0 ; for ( i = ( nr_par << 1 ) - 1 ; i > 0 ; i -- ) { index [ i ] = index [ i >> 1 ] ; } }


signature:
public class PS { /** * / * parse the bitstream data decoded in ps _ data ( ) */
private void ps_data_decode ( ) { } }

implementation:
int env , bin ; /* ps data not available , use data from previous frame */
if ( this . ps_data_available == 0 ) { this . num_env = 0 ; } for ( env = 0 ; env < this . num_env ; env ++ ) { int [ ] iid_index_prev ; int [ ] icc_index_prev ; int [ ] ipd_index_prev ; int [ ] opd_index_prev ; int num_iid_steps = ( this . iid_mode < 3 ) ? 7 : 15 /* fine quant */
; if ( env == 0 ) { /* take last envelope from previous frame */
iid_index_prev = this . iid_index_prev ; icc_index_prev = this . icc_index_prev ; ipd_index_prev = this . ipd_index_prev ; opd_index_prev = this . opd_index_prev ; } else { /* take index values from previous envelope */
iid_index_prev = this . iid_index [ env - 1 ] ; icc_index_prev = this . icc_index [ env - 1 ] ; ipd_index_prev = this . ipd_index [ env - 1 ] ; opd_index_prev = this . opd_index [ env - 1 ] ; } // iid = 1;
/* delta decode iid parameters */
delta_decode ( this . enable_iid , this . iid_index [ env ] , iid_index_prev , this . iid_dt [ env ] , this . nr_iid_par , ( this . iid_mode == 0 || this . iid_mode == 3 ) ? 2 : 1 , - num_iid_steps , num_iid_steps ) ; // iid = 0;
/* delta decode icc parameters */
delta_decode ( this . enable_icc , this . icc_index [ env ] , icc_index_prev , this . icc_dt [ env ] , this . nr_icc_par , ( this . icc_mode == 0 || this . icc_mode == 3 ) ? 2 : 1 , 0 , 7 ) ; /* delta modulo decode ipd parameters */
delta_modulo_decode ( this . enable_ipdopd , this . ipd_index [ env ] , ipd_index_prev , this . ipd_dt [ env ] , this . nr_ipdopd_par , 1 , 7 ) ; /* delta modulo decode opd parameters */
delta_modulo_decode ( this . enable_ipdopd , this . opd_index [ env ] , opd_index_prev , this . opd_dt [ env ] , this . nr_ipdopd_par , 1 , 7 ) ; } /* handle error case */
if ( this . num_env == 0 ) { /* force to 1 */
this . num_env = 1 ; if ( this . enable_iid ) { for ( bin = 0 ; bin < 34 ; bin ++ ) { this . iid_index [ 0 ] [ bin ] = this . iid_index_prev [ bin ] ; } } else { for ( bin = 0 ; bin < 34 ; bin ++ ) { this . iid_index [ 0 ] [ bin ] = 0 ; } } if ( this . enable_icc ) { for ( bin = 0 ; bin < 34 ; bin ++ ) { this . icc_index [ 0 ] [ bin ] = this . icc_index_prev [ bin ] ; } } else { for ( bin = 0 ; bin < 34 ; bin ++ ) { this . icc_index [ 0 ] [ bin ] = 0 ; } } if ( this . enable_ipdopd ) { for ( bin = 0 ; bin < 17 ; bin ++ ) { this . ipd_index [ 0 ] [ bin ] = this . ipd_index_prev [ bin ] ; this . opd_index [ 0 ] [ bin ] = this . opd_index_prev [ bin ] ; } } else { for ( bin = 0 ; bin < 17 ; bin ++ ) { this . ipd_index [ 0 ] [ bin ] = 0 ; this . opd_index [ 0 ] [ bin ] = 0 ; } } } /* update previous indices */
for ( bin = 0 ; bin < 34 ; bin ++ ) { this . iid_index_prev [ bin ] = this . iid_index [ this . num_env - 1 ] [ bin ] ; } for ( bin = 0 ; bin < 34 ; bin ++ ) { this . icc_index_prev [ bin ] = this . icc_index [ this . num_env - 1 ] [ bin ] ; } for ( bin = 0 ; bin < 17 ; bin ++ ) { this . ipd_index_prev [ bin ] = this . ipd_index [ this . num_env - 1 ] [ bin ] ; this . opd_index_prev [ bin ] = this . opd_index [ this . num_env - 1 ] [ bin ] ; } this . ps_data_available = 0 ; if ( this . frame_class == 0 ) { this . border_position [ 0 ] = 0 ; for ( env = 1 ; env < this . num_env ; env ++ ) { this . border_position [ env ] = ( env * this . numTimeSlotsRate ) / this . num_env ; } this . border_position [ this . num_env ] = this . numTimeSlotsRate ; } else { this . border_position [ 0 ] = 0 ; if ( this . border_position [ this . num_env ] < this . numTimeSlotsRate ) { for ( bin = 0 ; bin < 34 ; bin ++ ) { this . iid_index [ this . num_env ] [ bin ] = this . iid_index [ this . num_env - 1 ] [ bin ] ; this . icc_index [ this . num_env ] [ bin ] = this . icc_index [ this . num_env - 1 ] [ bin ] ; } for ( bin = 0 ; bin < 17 ; bin ++ ) { this . ipd_index [ this . num_env ] [ bin ] = this . ipd_index [ this . num_env - 1 ] [ bin ] ; this . opd_index [ this . num_env ] [ bin ] = this . opd_index [ this . num_env - 1 ] [ bin ] ; } this . num_env ++ ; this . border_position [ this . num_env ] = this . numTimeSlotsRate ; } for ( env = 1 ; env < this . num_env ; env ++ ) { int thr = this . numTimeSlotsRate - ( this . num_env - env ) ; if ( this . border_position [ env ] > thr ) { this . border_position [ env ] = thr ; } else { thr = this . border_position [ env - 1 ] + 1 ; if ( this . border_position [ env ] < thr ) { this . border_position [ env ] = thr ; } } } } /* make sure that the indices of all parameters can be mapped
 * to the same hybrid synthesis filterbank */
if ( this . use34hybrid_bands ) { for ( env = 0 ; env < this . num_env ; env ++ ) { if ( this . iid_mode != 2 && this . iid_mode != 5 ) map20indexto34 ( this . iid_index [ env ] , 34 ) ; if ( this . icc_mode != 2 && this . icc_mode != 5 ) map20indexto34 ( this . icc_index [ env ] , 34 ) ; if ( this . ipd_mode != 2 && this . ipd_mode != 5 ) { map20indexto34 ( this . ipd_index [ env ] , 17 ) ; map20indexto34 ( this . opd_index [ env ] , 17 ) ; } } }


signature:
public class PS { /** * / * decorrelate the mono signal using an allpass filter */
private void ps_decorrelate ( float [ ] [ ] [ ] X_left , float [ ] [ ] [ ] X_right , float [ ] [ ] [ ] X_hybrid_left , float [ ] [ ] [ ] X_hybrid_right ) { } }

implementation:
int gr , n , m , bk ; int temp_delay = 0 ; int sb , maxsb ; int [ ] temp_delay_ser = new int [ NO_ALLPASS_LINKS ] ; float P_SmoothPeakDecayDiffNrg , nrg ; float [ ] [ ] P = new float [ 32 ] [ 34 ] ; float [ ] [ ] G_TransientRatio = new float [ 32 ] [ 34 ] ; float [ ] inputLeft = new float [ 2 ] ; /* chose hybrid filterbank : 20 or 34 band case */
float [ ] [ ] Phi_Fract_SubQmf ; if ( this . use34hybrid_bands ) { Phi_Fract_SubQmf = Phi_Fract_SubQmf34 ; } else { Phi_Fract_SubQmf = Phi_Fract_SubQmf20 ; } /* clear the energy values */
for ( n = 0 ; n < 32 ; n ++ ) { for ( bk = 0 ; bk < 34 ; bk ++ ) { P [ n ] [ bk ] = 0 ; } } /* calculate the energy in each parameter band b ( k ) */
for ( gr = 0 ; gr < this . num_groups ; gr ++ ) { /* select the parameter index b ( k ) to which this group belongs */
bk = ( ~ NEGATE_IPD_MASK ) & this . map_group2bk [ gr ] ; /* select the upper subband border for this group */
maxsb = ( gr < this . num_hybrid_groups ) ? this . group_border [ gr ] + 1 : this . group_border [ gr + 1 ] ; for ( sb = this . group_border [ gr ] ; sb < maxsb ; sb ++ ) { for ( n = this . border_position [ 0 ] ; n < this . border_position [ this . num_env ] ; n ++ ) { /* input from hybrid subbands or QMF subbands */
if ( gr < this . num_hybrid_groups ) { inputLeft [ 0 ] = X_hybrid_left [ n ] [ sb ] [ 0 ] ; inputLeft [ 1 ] = X_hybrid_left [ n ] [ sb ] [ 1 ] ; } else { inputLeft [ 0 ] = X_left [ n ] [ sb ] [ 0 ] ; inputLeft [ 1 ] = X_left [ n ] [ sb ] [ 1 ] ; } /* accumulate energy */
P [ n ] [ bk ] += ( inputLeft [ 0 ] * inputLeft [ 0 ] ) + ( inputLeft [ 1 ] * inputLeft [ 1 ] ) ; } } } /* calculate transient reduction ratio for each parameter band b ( k ) */
for ( bk = 0 ; bk < this . nr_par_bands ; bk ++ ) { for ( n = this . border_position [ 0 ] ; n < this . border_position [ this . num_env ] ; n ++ ) { float gamma = 1.5f ; this . P_PeakDecayNrg [ bk ] = ( this . P_PeakDecayNrg [ bk ] * this . alpha_decay ) ; if ( this . P_PeakDecayNrg [ bk ] < P [ n ] [ bk ] ) this . P_PeakDecayNrg [ bk ] = P [ n ] [ bk ] ; /* apply smoothing filter to peak decay energy */
P_SmoothPeakDecayDiffNrg = this . P_SmoothPeakDecayDiffNrg_prev [ bk ] ; P_SmoothPeakDecayDiffNrg += ( ( this . P_PeakDecayNrg [ bk ] - P [ n ] [ bk ] - this . P_SmoothPeakDecayDiffNrg_prev [ bk ] ) * alpha_smooth ) ; this . P_SmoothPeakDecayDiffNrg_prev [ bk ] = P_SmoothPeakDecayDiffNrg ; /* apply smoothing filter to energy */
nrg = this . P_prev [ bk ] ; nrg += ( ( P [ n ] [ bk ] - this . P_prev [ bk ] ) * this . alpha_smooth ) ; this . P_prev [ bk ] = nrg ; /* calculate transient ratio */
if ( ( P_SmoothPeakDecayDiffNrg * gamma ) <= nrg ) { G_TransientRatio [ n ] [ bk ] = 1.0f ; } else { G_TransientRatio [ n ] [ bk ] = ( nrg / ( P_SmoothPeakDecayDiffNrg * gamma ) ) ; } } } /* apply stereo decorrelation filter to the signal */
for ( gr = 0 ; gr < this . num_groups ; gr ++ ) { if ( gr < this . num_hybrid_groups ) maxsb = this . group_border [ gr ] + 1 ; else maxsb = this . group_border [ gr + 1 ] ; /* QMF channel */
for ( sb = this . group_border [ gr ] ; sb < maxsb ; sb ++ ) { float g_DecaySlope ; float [ ] g_DecaySlope_filt = new float [ NO_ALLPASS_LINKS ] ; /* g _ DecaySlope : [ 0 . . 1] */
if ( gr < this . num_hybrid_groups || sb <= this . decay_cutoff ) { g_DecaySlope = 1.0f ; } else { int decay = this . decay_cutoff - sb ; if ( decay <= - 20 /* -1 / DECAY _ SLOPE */
) { g_DecaySlope = 0 ; } else { /* decay ( int ) * decay _ slope ( frac ) = g _ DecaySlope ( frac ) */
g_DecaySlope = 1.0f + DECAY_SLOPE * decay ; } } /* calculate g _ DecaySlope _ filt for every m multiplied by filter _ a [ m ] */
for ( m = 0 ; m < NO_ALLPASS_LINKS ; m ++ ) { g_DecaySlope_filt [ m ] = g_DecaySlope * filter_a [ m ] ; } /* set delay indices */
temp_delay = this . saved_delay ; for ( n = 0 ; n < NO_ALLPASS_LINKS ; n ++ ) { temp_delay_ser [ n ] = this . delay_buf_index_ser [ n ] ; } for ( n = this . border_position [ 0 ] ; n < this . border_position [ this . num_env ] ; n ++ ) { float [ ] tmp = new float [ 2 ] , tmp0 = new float [ 2 ] , R0 = new float [ 2 ] ; if ( gr < this . num_hybrid_groups ) { /* hybrid filterbank input */
inputLeft [ 0 ] = X_hybrid_left [ n ] [ sb ] [ 0 ] ; inputLeft [ 1 ] = X_hybrid_left [ n ] [ sb ] [ 1 ] ; } else { /* QMF filterbank input */
inputLeft [ 0 ] = X_left [ n ] [ sb ] [ 0 ] ; inputLeft [ 1 ] = X_left [ n ] [ sb ] [ 1 ] ; } if ( sb > this . nr_allpass_bands && gr >= this . num_hybrid_groups ) { /* delay */
/* never hybrid subbands here , always QMF subbands */
tmp [ 0 ] = this . delay_Qmf [ this . delay_buf_index_delay [ sb ] ] [ sb ] [ 0 ] ; tmp [ 1 ] = this . delay_Qmf [ this . delay_buf_index_delay [ sb ] ] [ sb ] [ 1 ] ; R0 [ 0 ] = tmp [ 0 ] ; R0 [ 1 ] = tmp [ 1 ] ; this . delay_Qmf [ this . delay_buf_index_delay [ sb ] ] [ sb ] [ 0 ] = inputLeft [ 0 ] ; this . delay_Qmf [ this . delay_buf_index_delay [ sb ] ] [ sb ] [ 1 ] = inputLeft [ 1 ] ; } else { /* allpass filter */
// int m ;
float [ ] Phi_Fract = new float [ 2 ] ; /* fetch parameters */
if ( gr < this . num_hybrid_groups ) { /* select data from the hybrid subbands */
tmp0 [ 0 ] = this . delay_SubQmf [ temp_delay ] [ sb ] [ 0 ] ; tmp0 [ 1 ] = this . delay_SubQmf [ temp_delay ] [ sb ] [ 1 ] ; this . delay_SubQmf [ temp_delay ] [ sb ] [ 0 ] = inputLeft [ 0 ] ; this . delay_SubQmf [ temp_delay ] [ sb ] [ 1 ] = inputLeft [ 1 ] ; Phi_Fract [ 0 ] = Phi_Fract_SubQmf [ sb ] [ 0 ] ; Phi_Fract [ 1 ] = Phi_Fract_SubQmf [ sb ] [ 1 ] ; } else { /* select data from the QMF subbands */
tmp0 [ 0 ] = this . delay_Qmf [ temp_delay ] [ sb ] [ 0 ] ; tmp0 [ 1 ] = this . delay_Qmf [ temp_delay ] [ sb ] [ 1 ] ; this . delay_Qmf [ temp_delay ] [ sb ] [ 0 ] = inputLeft [ 0 ] ; this . delay_Qmf [ temp_delay ] [ sb ] [ 1 ] = inputLeft [ 1 ] ; Phi_Fract [ 0 ] = Phi_Fract_Qmf [ sb ] [ 0 ] ; Phi_Fract [ 1 ] = Phi_Fract_Qmf [ sb ] [ 1 ] ; } /* z ^ ( - 2 ) * Phi _ Fract [ k ] */
tmp [ 0 ] = ( tmp [ 0 ] * Phi_Fract [ 0 ] ) + ( tmp0 [ 1 ] * Phi_Fract [ 1 ] ) ; tmp [ 1 ] = ( tmp0 [ 1 ] * Phi_Fract [ 0 ] ) - ( tmp0 [ 0 ] * Phi_Fract [ 1 ] ) ; R0 [ 0 ] = tmp [ 0 ] ; R0 [ 1 ] = tmp [ 1 ] ; for ( m = 0 ; m < NO_ALLPASS_LINKS ; m ++ ) { float [ ] Q_Fract_allpass = new float [ 2 ] , tmp2 = new float [ 2 ] ; /* fetch parameters */
if ( gr < this . num_hybrid_groups ) { /* select data from the hybrid subbands */
tmp0 [ 0 ] = this . delay_SubQmf_ser [ m ] [ temp_delay_ser [ m ] ] [ sb ] [ 0 ] ; tmp0 [ 1 ] = this . delay_SubQmf_ser [ m ] [ temp_delay_ser [ m ] ] [ sb ] [ 1 ] ; if ( this . use34hybrid_bands ) { Q_Fract_allpass [ 0 ] = Q_Fract_allpass_SubQmf34 [ sb ] [ m ] [ 0 ] ; Q_Fract_allpass [ 1 ] = Q_Fract_allpass_SubQmf34 [ sb ] [ m ] [ 1 ] ; } else { Q_Fract_allpass [ 0 ] = Q_Fract_allpass_SubQmf20 [ sb ] [ m ] [ 0 ] ; Q_Fract_allpass [ 1 ] = Q_Fract_allpass_SubQmf20 [ sb ] [ m ] [ 1 ] ; } } else { /* select data from the QMF subbands */
tmp0 [ 0 ] = this . delay_Qmf_ser [ m ] [ temp_delay_ser [ m ] ] [ sb ] [ 0 ] ; tmp0 [ 1 ] = this . delay_Qmf_ser [ m ] [ temp_delay_ser [ m ] ] [ sb ] [ 1 ] ; Q_Fract_allpass [ 0 ] = Q_Fract_allpass_Qmf [ sb ] [ m ] [ 0 ] ; Q_Fract_allpass [ 1 ] = Q_Fract_allpass_Qmf [ sb ] [ m ] [ 1 ] ; } /* delay by a fraction */
/* z ^ ( - d ( m ) ) * Q _ Fract _ allpass [ k , m ] */
tmp [ 0 ] = ( tmp0 [ 0 ] * Q_Fract_allpass [ 0 ] ) + ( tmp0 [ 1 ] * Q_Fract_allpass [ 1 ] ) ; tmp [ 1 ] = ( tmp0 [ 1 ] * Q_Fract_allpass [ 0 ] ) - ( tmp0 [ 0 ] * Q_Fract_allpass [ 1 ] ) ; /* - a ( m ) * g _ DecaySlope [ k ] */
tmp [ 0 ] += - ( g_DecaySlope_filt [ m ] * R0 [ 0 ] ) ; tmp [ 1 ] += - ( g_DecaySlope_filt [ m ] * R0 [ 1 ] ) ; /* - a ( m ) * g _ DecaySlope [ k ] * Q _ Fract _ allpass [ k , m ] * z ^ ( - d ( m ) ) */
tmp2 [ 0 ] = R0 [ 0 ] + ( g_DecaySlope_filt [ m ] * tmp [ 0 ] ) ; tmp2 [ 1 ] = R0 [ 1 ] + ( g_DecaySlope_filt [ m ] * tmp [ 1 ] ) ; /* store sample */
if ( gr < this . num_hybrid_groups ) { this . delay_SubQmf_ser [ m ] [ temp_delay_ser [ m ] ] [ sb ] [ 0 ] = tmp2 [ 0 ] ; this . delay_SubQmf_ser [ m ] [ temp_delay_ser [ m ] ] [ sb ] [ 1 ] = tmp2 [ 1 ] ; } else { this . delay_Qmf_ser [ m ] [ temp_delay_ser [ m ] ] [ sb ] [ 0 ] = tmp2 [ 0 ] ; this . delay_Qmf_ser [ m ] [ temp_delay_ser [ m ] ] [ sb ] [ 1 ] = tmp2 [ 1 ] ; } /* store for next iteration ( or as output value if last iteration ) */
R0 [ 0 ] = tmp [ 0 ] ; R0 [ 1 ] = tmp [ 1 ] ; } } /* select b ( k ) for reading the transient ratio */
bk = ( ~ NEGATE_IPD_MASK ) & this . map_group2bk [ gr ] ; /* duck if a past transient is found */
R0 [ 0 ] = ( G_TransientRatio [ n ] [ bk ] * R0 [ 0 ] ) ; R0 [ 1 ] = ( G_TransientRatio [ n ] [ bk ] * R0 [ 1 ] ) ; if ( gr < this . num_hybrid_groups ) { /* hybrid */
X_hybrid_right [ n ] [ sb ] [ 0 ] = R0 [ 0 ] ; X_hybrid_right [ n ] [ sb ] [ 1 ] = R0 [ 1 ] ; } else { /* QMF */
X_right [ n ] [ sb ] [ 0 ] = R0 [ 0 ] ; X_right [ n ] [ sb ] [ 1 ] = R0 [ 1 ] ; } /* Update delay buffer index */
if ( ++ temp_delay >= 2 ) { temp_delay = 0 ; } /* update delay indices */
if ( sb > this . nr_allpass_bands && gr >= this . num_hybrid_groups ) { /* delay _ D depends on the samplerate , it can hold the values 14 and 1 */
if ( ++ this . delay_buf_index_delay [ sb ] >= this . delay_D [ sb ] ) { this . delay_buf_index_delay [ sb ] = 0 ; } } for ( m = 0 ; m < NO_ALLPASS_LINKS ; m ++ ) { if ( ++ temp_delay_ser [ m ] >= this . num_sample_delay_ser [ m ] ) { temp_delay_ser [ m ] = 0 ; } } } } } /* update delay indices */
this . saved_delay = temp_delay ; for ( m = 0 ; m < NO_ALLPASS_LINKS ; m ++ ) { this . delay_buf_index_ser [ m ] = temp_delay_ser [ m ] ; }


signature:
public class PS { /** * / * main Parametric Stereo decoding function */
public int process ( float [ ] [ ] [ ] X_left , float [ ] [ ] [ ] X_right ) { } }

implementation:
float [ ] [ ] [ ] X_hybrid_left = new float [ 32 ] [ 32 ] [ 2 ] ; float [ ] [ ] [ ] X_hybrid_right = new float [ 32 ] [ 32 ] [ 2 ] ; /* delta decoding of the bitstream data */
ps_data_decode ( ) ; /* set up some parameters depending on filterbank type */
if ( this . use34hybrid_bands ) { this . group_border = group_border34 ; this . map_group2bk = map_group2bk34 ; this . num_groups = 32 + 18 ; this . num_hybrid_groups = 32 ; this . nr_par_bands = 34 ; this . decay_cutoff = 5 ; } else { this . group_border = group_border20 ; this . map_group2bk = map_group2bk20 ; this . num_groups = 10 + 12 ; this . num_hybrid_groups = 10 ; this . nr_par_bands = 20 ; this . decay_cutoff = 3 ; } /* Perform further analysis on the lowest subbands to get a higher
 * frequency resolution */
hyb . hybrid_analysis ( X_left , X_hybrid_left , this . use34hybrid_bands , this . numTimeSlotsRate ) ; /* decorrelate mono signal */
ps_decorrelate ( X_left , X_right , X_hybrid_left , X_hybrid_right ) ; /* apply mixing and phase parameters */
ps_mix_phase ( X_left , X_right , X_hybrid_left , X_hybrid_right ) ; /* hybrid synthesis , to rebuild the SBR QMF matrices */
hyb . hybrid_synthesis ( X_left , X_hybrid_left , this . use34hybrid_bands , this . numTimeSlotsRate ) ; hyb . hybrid_synthesis ( X_right , X_hybrid_right , this . use34hybrid_bands , this . numTimeSlotsRate ) ; return 0 ;


signature:
public class SampleFrequency { /** * Returns a sample frequency instance for the given index . If the index is
 * not between 0 and 11 inclusive , SAMPLE _ FREQUENCY _ NONE is returned .
 * @ return a sample frequency with the given index */
public static SampleFrequency forInt ( int i ) { } }

implementation: final SampleFrequency freq ; if ( i >= 0 && i < 12 ) freq = values ( ) [ i ] ; else freq = SAMPLE_FREQUENCY_NONE ; return freq ;


signature:
public class MPEGPredDbl { /** * this may be a result of color greening out in long GOPs . */
@ Override public void predictPlane ( byte [ ] ref , int refX , int refY , int refW , int refH , int refVertStep , int refVertOff , int [ ] tgt , int tgtY , int tgtW , int tgtH , int tgtVertStep ) { } }

implementation: super . predictPlane ( ref , refX << 1 , refY << 1 , refW , refH , refVertStep , refVertOff , tgt , tgtY , tgtW << 2 , tgtH << 2 , tgtVertStep ) ;


signature:
public class Picture { /** * Creates a cropped clone of this picture .
 * @ return */
public Picture cloneCropped ( ) { } }

implementation: if ( cropNeeded ( ) ) { return cropped ( ) ; } else { Picture clone = createCompatible ( ) ; clone . copyFrom ( this ) ; return clone ; }


signature:
public class HCR { /** * sectionDataResilience = hDecoder - > aacSectionDataResilienceFlag */
public static void decodeReorderedSpectralData ( ICStream ics , IBitStream _in , short [ ] spectralData , boolean sectionDataResilience ) throws AACException { } }

implementation:
final ICSInfo info = ics . getInfo ( ) ; final int windowGroupCount = info . getWindowGroupCount ( ) ; final int maxSFB = info . getMaxSFB ( ) ; final int [ ] swbOffsets = info . getSWBOffsets ( ) ; final int swbOffsetMax = info . getSWBOffsetMax ( ) ; // TODO :
// final SectionData sectData = ics . getSectionData ( ) ;
final int [ ] [ ] sectStart = new int [ 0 ] [ 0 ] ; // sectData . getSectStart ( ) ;
final int [ ] [ ] sectEnd = new int [ 0 ] [ 0 ] ; // sectData . getSectEnd ( ) ;
final int [ ] numSec = new int [ 0 ] ; // sectData . getNumSec ( ) ;
final int [ ] [ ] sectCB = new int [ 0 ] [ 0 ] ; // sectData . getSectCB ( ) ;
final int [ ] [ ] sectSFBOffsets = new int [ 0 ] [ 0 ] ; // info . getSectSFBOffsets ( ) ;
// check parameter
final int spDataLen = ics . getReorderedSpectralDataLength ( ) ; if ( spDataLen == 0 ) return ; final int longestLen = ics . getLongestCodewordLength ( ) ; if ( longestLen == 0 || longestLen >= spDataLen ) throw new AACException ( "length of longest HCR codeword out of range" ) ; // create spOffsets
final int [ ] spOffsets = new int [ 8 ] ; final int shortFrameLen = spectralData . length / 8 ; spOffsets [ 0 ] = 0 ; int g ; for ( g = 1 ; g < windowGroupCount ; g ++ ) { spOffsets [ g ] = spOffsets [ g - 1 ] + shortFrameLen * info . getWindowGroupLength ( g - 1 ) ; } final Codeword [ ] codeword = new Codeword [ 512 ] ; final BitsBuffer [ ] segment = new BitsBuffer [ 512 ] ; int lastCB ; int [ ] preSortCB ; if ( sectionDataResilience ) { preSortCB = PRE_SORT_CB_ER ; lastCB = NUM_CB_ER ; } else { preSortCB = PRE_SORT_CB_STD ; lastCB = NUM_CB ; } int PCWs_done = 0 ; int segmentsCount = 0 ; int numberOfCodewords = 0 ; int bitsread = 0 ; int sfb , w_idx , i , thisCB , thisSectCB , cws ; // step 1 : decode PCW ' s ( set 0 ) , and stuff data in easier - to - use format
for ( int sortloop = 0 ; sortloop < lastCB ; sortloop ++ ) { // select codebook to process this pass
thisCB = preSortCB [ sortloop ] ; for ( sfb = 0 ; sfb < maxSFB ; sfb ++ ) { for ( w_idx = 0 ; 4 * w_idx < ( Math . min ( swbOffsets [ sfb + 1 ] , swbOffsetMax ) - swbOffsets [ sfb ] ) ; w_idx ++ ) { for ( g = 0 ; g < windowGroupCount ; g ++ ) { for ( i = 0 ; i < numSec [ g ] ; i ++ ) { if ( ( sectStart [ g ] [ i ] <= sfb ) && ( sectEnd [ g ] [ i ] > sfb ) ) { /* check whether codebook used here is the one we want to process */
thisSectCB = sectCB [ g ] [ i ] ; if ( isGoodCB ( thisCB , thisSectCB ) ) { // precalculation
int sect_sfb_size = sectSFBOffsets [ g ] [ sfb + 1 ] - sectSFBOffsets [ g ] [ sfb ] ; int inc = ( thisSectCB < HCB . FIRST_PAIR_HCB ) ? 4 : 2 ; int group_cws_count = ( 4 * info . getWindowGroupLength ( g ) ) / inc ; int segwidth = Math . min ( MAX_CW_LEN [ thisSectCB ] , longestLen ) ; // read codewords until end of sfb or end of window group
for ( cws = 0 ; ( cws < group_cws_count ) && ( ( cws + w_idx * group_cws_count ) < sect_sfb_size ) ; cws ++ ) { int sp = spOffsets [ g ] + sectSFBOffsets [ g ] [ sfb ] + inc * ( cws + w_idx * group_cws_count ) ; // read and decode PCW
if ( PCWs_done == 0 ) { // read in normal segments
if ( bitsread + segwidth <= spDataLen ) { segment [ segmentsCount ] . readSegment ( segwidth , _in ) ; bitsread += segwidth ; // Huffman . decodeSpectralDataER ( segment [ segmentsCount ] , thisSectCB , spectralData , sp ) ;
// keep leftover bits
segment [ segmentsCount ] . rewindReverse ( ) ; segmentsCount ++ ; } else { // remaining after last segment
if ( bitsread < spDataLen ) { int additional_bits = spDataLen - bitsread ; segment [ segmentsCount ] . readSegment ( additional_bits , _in ) ; segment [ segmentsCount ] . len += segment [ segmentsCount - 1 ] . len ; segment [ segmentsCount ] . rewindReverse ( ) ; if ( segment [ segmentsCount - 1 ] . len > 32 ) { segment [ segmentsCount - 1 ] . bufb = segment [ segmentsCount ] . bufb + segment [ segmentsCount - 1 ] . showBits ( segment [ segmentsCount - 1 ] . len - 32 ) ; segment [ segmentsCount - 1 ] . bufa = segment [ segmentsCount ] . bufa + segment [ segmentsCount - 1 ] . showBits ( 32 ) ; } else { segment [ segmentsCount - 1 ] . bufa = segment [ segmentsCount ] . bufa + segment [ segmentsCount - 1 ] . showBits ( segment [ segmentsCount - 1 ] . len ) ; segment [ segmentsCount - 1 ] . bufb = segment [ segmentsCount ] . bufb ; } segment [ segmentsCount - 1 ] . len += additional_bits ; } bitsread = spDataLen ; PCWs_done = 1 ; codeword [ 0 ] . fill ( sp , thisSectCB ) ; } } else { codeword [ numberOfCodewords - segmentsCount ] . fill ( sp , thisSectCB ) ; } numberOfCodewords ++ ; } } } } } } } } if ( segmentsCount == 0 ) throw new AACException ( "no segments _in HCR" ) ; final int numberOfSets = numberOfCodewords / segmentsCount ; // step 2 : decode nonPCWs
int trial , codewordBase , segmentID , codewordID ; for ( int set = 1 ; set <= numberOfSets ; set ++ ) { for ( trial = 0 ; trial < segmentsCount ; trial ++ ) { for ( codewordBase = 0 ; codewordBase < segmentsCount ; codewordBase ++ ) { segmentID = ( trial + codewordBase ) % segmentsCount ; codewordID = codewordBase + set * segmentsCount - segmentsCount ; // data up
if ( codewordID >= numberOfCodewords - segmentsCount ) break ; if ( ( codeword [ codewordID ] . decoded == 0 ) && ( segment [ segmentID ] . len > 0 ) ) { if ( codeword [ codewordID ] . bits . len != 0 ) segment [ segmentID ] . concatBits ( codeword [ codewordID ] . bits ) ; int tmplen = segment [ segmentID ] . len ; /* int ret = Huffman . decodeSpectralDataER ( segment [ segmentID ] , codeword [ codewordID ] . cb ,
 spectralData , codeword [ codewordID ] . sp _ offset ) ;
 if ( ret > = 0 ) codeword [ codewordID ] . decoded = 1;
 else {
 codeword [ codewordID ] . bits = segment [ segmentID ] ;
 codeword [ codewordID ] . bits . len = tmplen ; */
} } } for ( i = 0 ; i < segmentsCount ; i ++ ) { segment [ i ] . rewindReverse ( ) ; } }


signature:
public class SparseIDCT { /** * Starts DCT reconstruction
 * Faster then call to ' coeff ' with ind = 0
 * @ param block
 * @ param dc */
public static final void start ( int [ ] block , int dc ) { } }

implementation: dc <<= DC_SHIFT ; for ( int i = 0 ; i < 64 ; i += 4 ) { block [ i + 0 ] = dc ; block [ i + 1 ] = dc ; block [ i + 2 ] = dc ; block [ i + 3 ] = dc ; }


signature:
public class SparseIDCT { /** * Recalculates image based on new DCT coefficient
 * @ param block
 * @ param ind
 * @ param level */
public static final void coeff ( int [ ] block , int ind , int level ) { } }

implementation: for ( int i = 0 ; i < 64 ; i += 4 ) { block [ i ] += COEFF [ ind ] [ i ] * level ; block [ i + 1 ] += COEFF [ ind ] [ i + 1 ] * level ; block [ i + 2 ] += COEFF [ ind ] [ i + 2 ] * level ; block [ i + 3 ] += COEFF [ ind ] [ i + 3 ] * level ; }


signature:
public class SparseIDCT { /** * Finalizes DCT calculation
 * @ param block */
public static final void finish ( int block [ ] ) { } }

implementation: for ( int i = 0 ; i < 64 ; i += 4 ) { block [ i ] = div ( block [ i ] ) ; block [ i + 1 ] = div ( block [ i + 1 ] ) ; block [ i + 2 ] = div ( block [ i + 2 ] ) ; block [ i + 3 ] = div ( block [ i + 3 ] ) ; }


signature:
public class H264Decoder { /** * Constructs this decoder from a portion of a stream that contains AnnexB
 * delimited ( 00 00 00 01 ) SPS / PPS NAL units . SPS / PPS NAL units are 0x67 and
 * 0x68 respectfully .
 * @ param codecPrivate */
public static H264Decoder createH264DecoderFromCodecPrivate ( ByteBuffer codecPrivate ) { } }

implementation: H264Decoder d = new H264Decoder ( ) ; for ( ByteBuffer bb : H264Utils . splitFrame ( codecPrivate . duplicate ( ) ) ) { NALUnit nu = NALUnit . read ( bb ) ; if ( nu . type == NALUnitType . SPS ) { d . reader . addSps ( bb ) ; } else if ( nu . type == NALUnitType . PPS ) { d . reader . addPps ( bb ) ; } } return d ;


signature:
public class MKVType { /** * TODO : this may be optimized of - course if it turns out to be a frequently called method */
public static MKVType getParent ( MKVType t ) { } }

implementation: for ( Entry < MKVType , Set < MKVType > > ent : children . entrySet ( ) ) { if ( ent . getValue ( ) . contains ( t ) ) return ent . getKey ( ) ; } return null ;


signature:
public class BitsBuffer { /** * merge bits of a to b */
public void concatBits ( BitsBuffer a ) { } }

implementation:
if ( a . len == 0 ) return ; int al = a . bufa ; int ah = a . bufb ; int bl , bh ; if ( len > 32 ) { // mask off superfluous high b bits
bl = bufa ; bh = bufb & ( ( 1 << ( len - 32 ) ) - 1 ) ; // left shift a len bits
ah = al << ( len - 32 ) ; al = 0 ; } else { bl = bufa & ( ( 1 << ( len ) ) - 1 ) ; bh = 0 ; ah = ( ah << ( len ) ) | ( al >> ( 32 - len ) ) ; al = al << len ; } // merge
bufa = bl | al ; bufb = bh | ah ; len += a . len ;


signature:
public class BitsBuffer { /** * 32 bit rewind and reverse */
static int rewindReverse32 ( int v , int len ) { } }


signature:
public class BitsBuffer { /** * 64 bit rewind and reverse */
static int [ ] rewindReverse64 ( int hi , int lo , int len ) { } }


signature:
public class ICStream { /** * / * = = = = = decoding = = = = = */
public void decode ( IBitStream _in , boolean commonWindow , AACDecoderConfig conf ) throws AACException { } }

implementation:
if ( conf . isScalefactorResilienceUsed ( ) && rvlc == null ) rvlc = new RVLC ( ) ; final boolean er = conf . getProfile ( ) . isErrorResilientProfile ( ) ; globalGain = _in . readBits ( 8 ) ; if ( ! commonWindow ) info . decode ( _in , conf , commonWindow ) ; decodeSectionData ( _in , conf . isSectionDataResilienceUsed ( ) ) ; // if ( conf . isScalefactorResilienceUsed ( ) ) rvlc . decode ( _ in , this , scaleFactors ) ;
/* else */
decodeScaleFactors ( _in ) ; pulseDataPresent = _in . readBool ( ) ; if ( pulseDataPresent ) { if ( info . isEightShortFrame ( ) ) throw new AACException ( "pulse data not allowed for short frames" ) ; Logger . debug ( "PULSE" ) ; decodePulseData ( _in ) ; } tnsDataPresent = _in . readBool ( ) ; if ( tnsDataPresent && ! er ) { if ( tns == null ) tns = new TNS ( ) ; tns . decode ( _in , info ) ; } gainControlPresent = _in . readBool ( ) ; if ( gainControlPresent ) { if ( gainControl == null ) gainControl = new GainControl ( frameLength ) ; Logger . debug ( "GAIN" ) ; gainControl . decode ( _in , info . getWindowSequence ( ) ) ; } // RVLC spectral data
// if ( conf . isScalefactorResilienceUsed ( ) ) rvlc . decodeScalefactors ( this , _ in , scaleFactors ) ;
if ( conf . isSpectralDataResilienceUsed ( ) ) { int max = ( conf . getChannelConfiguration ( ) == ChannelConfiguration . CHANNEL_CONFIG_STEREO ) ? 6144 : 12288 ; reorderedSpectralDataLen = Math . max ( _in . readBits ( 14 ) , max ) ; longestCodewordLen = Math . max ( _in . readBits ( 6 ) , 49 ) ; // HCR . decodeReorderedSpectralData ( this , _ in , data , conf . isSectionDataResilienceUsed ( ) ) ;
} else decodeSpectralData ( _in ) ;


signature: public class Controls { private void scheduleClose ( ) { } }

implementation: if ( task != null ) task . cancel ( ) ; task = new TimerTask ( ) { public void run ( ) { state = State . HIDING ; } } ; timer . schedule ( task , 1000 ) ;


signature:
public class AndroidFrameGrab { /** * Get frame at a specified second as AWT image
 * @ param file
 * @ param second
 * @ return A decoded frame from a given point in video .
 * @ throws IOException
 * @ throws JCodecException */
public static Bitmap getFrame ( File file , double second ) throws IOException , JCodecException { } }

implementation: FileChannelWrapper ch = null ; try { ch = NIOUtils . readableChannel ( file ) ; return ( ( AndroidFrameGrab ) createAndroidFrameGrab ( ch ) . seekToSecondPrecise ( second ) ) . getFrame ( ) ; } finally { NIOUtils . closeQuietly ( ch ) ; }


signature:
public class AndroidFrameGrab { /** * Get frame at a specified second as AWT image
 * @ param file
 * @ param second
 * @ return A decoded frame from a given point in video .
 * @ throws UnsupportedFormatException
 * @ throws IOException */
public static Bitmap getFrame ( SeekableByteChannel file , double second ) throws JCodecException , IOException { } }

implementation: return ( ( AndroidFrameGrab ) createAndroidFrameGrab ( file ) . seekToSecondPrecise ( second ) ) . getFrame ( ) ;


signature:
public class AndroidFrameGrab { /** * Get frame at current position in AWT image
 * @ return A decoded frame with metadata .
 * @ throws IOException */
public BitmapWithMetadata getFrameWithMetadata ( ) throws IOException { } }

implementation: PictureWithMetadata pictureWithMeta = getNativeFrameWithMetadata ( ) ; if ( pictureWithMeta == null ) return null ; Bitmap bitmap = AndroidUtil . toBitmap ( pictureWithMeta . getPicture ( ) ) ; return new BitmapWithMetadata ( bitmap , pictureWithMeta . getTimestamp ( ) , pictureWithMeta . getDuration ( ) ) ;


signature:
public class AndroidFrameGrab { /** * Get frame at current position in AWT image
 * @ throws IOException */
public void getFrame ( Bitmap bmp ) throws IOException { } }

implementation: Picture picture = getNativeFrame ( ) ; AndroidUtil . toBitmap ( picture , bmp ) ;


signature:
public class AndroidFrameGrab { /** * Get frame at current position in AWT image
 * @ return A decoded picture with metadata . A bitmap provided is used .
 * @ throws IOException */
public BitmapWithMetadata getFrameWithMetadata ( Bitmap bmp ) throws IOException { } }

implementation: PictureWithMetadata pictureWithMetadata = getNativeFrameWithMetadata ( ) ; if ( pictureWithMetadata == null ) return null ; AndroidUtil . toBitmap ( pictureWithMetadata . getPicture ( ) , bmp ) ; return new BitmapWithMetadata ( bmp , pictureWithMetadata . getTimestamp ( ) , pictureWithMetadata . getDuration ( ) ) ;


signature:
public class AndroidFrameGrab { /** * Get frame at a specified frame number as AWT image
 * @ param file
 * @ param second
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static Bitmap getFrame ( File file , int frameNumber ) throws IOException , JCodecException { } }

implementation: FileChannelWrapper ch = null ; try { ch = NIOUtils . readableChannel ( file ) ; return ( ( AndroidFrameGrab ) createAndroidFrameGrab ( ch ) . seekToFramePrecise ( frameNumber ) ) . getFrame ( ) ; } finally { NIOUtils . closeQuietly ( ch ) ; }


signature:
public class AndroidFrameGrab { /** * Get frame at a specified frame number as AWT image
 * @ param file
 * @ param second
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static Bitmap getFrame ( SeekableByteChannel file , int frameNumber ) throws JCodecException , IOException { } }

implementation: return ( ( AndroidFrameGrab ) createAndroidFrameGrab ( file ) . seekToFramePrecise ( frameNumber ) ) . getFrame ( ) ;


signature:
public class AndroidFrameGrab { /** * Get a specified frame by number from an already open demuxer track
 * @ param vt
 * @ param decoder
 * @ param frameNumber
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static Bitmap getFrame ( SeekableDemuxerTrack vt , ContainerAdaptor decoder , int frameNumber ) throws IOException , JCodecException { } }

implementation: return ( ( AndroidFrameGrab ) new AndroidFrameGrab ( vt , decoder ) . seekToFramePrecise ( frameNumber ) ) . getFrame ( ) ;


signature:
public class AndroidFrameGrab { /** * Get a specified frame by second from an already open demuxer track
 * @ param vt
 * @ param decoder
 * @ param frameNumber
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static Bitmap getFrame ( SeekableDemuxerTrack vt , ContainerAdaptor decoder , double second ) throws IOException , JCodecException { } }

implementation: return ( ( AndroidFrameGrab ) new AndroidFrameGrab ( vt , decoder ) . seekToSecondPrecise ( second ) ) . getFrame ( ) ;


signature:
public class AndroidFrameGrab { /** * Get a specified frame by number from an already open demuxer track (
 * sloppy mode , i . e . nearest keyframe )
 * @ param vt
 * @ param decoder
 * @ param frameNumber
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static Bitmap getFrameSloppy ( SeekableDemuxerTrack vt , ContainerAdaptor decoder , int frameNumber ) throws IOException , JCodecException { } }

implementation: return ( ( AndroidFrameGrab ) new AndroidFrameGrab ( vt , decoder ) . seekToFrameSloppy ( frameNumber ) ) . getFrame ( ) ;


signature:
public class AndroidFrameGrab { /** * Get a specified frame by second from an already open demuxer track (
 * sloppy mode , i . e . nearest keyframe )
 * @ param vt
 * @ param decoder
 * @ param frameNumber
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static Bitmap getFrameSloppy ( SeekableDemuxerTrack vt , ContainerAdaptor decoder , double second ) throws IOException , JCodecException { } }

implementation: return ( ( AndroidFrameGrab ) new AndroidFrameGrab ( vt , decoder ) . seekToSecondSloppy ( second ) ) . getFrame ( ) ;


signature:
public class SourceImpl { /** * Seeks to a previous key frame prior or on the given frame , if the track is
 * not seekable returns 0.
 * @ param frame
 * A frame to seek
 * @ return Frame number of a key frame or 0 if the track is not seekable .
 * @ throws IOException */
protected int seekToKeyFrame ( int frame ) throws IOException { } }

implementation: if ( videoInputTrack instanceof SeekableDemuxerTrack ) { SeekableDemuxerTrack seekable = ( SeekableDemuxerTrack ) videoInputTrack ; seekable . gotoSyncFrame ( frame ) ; return ( int ) seekable . getCurFrame ( ) ; } else { Logger . warn ( "Can not seek in " + videoInputTrack + " container." ) ; return - 1 ; }


signature:
public class SourceImpl { /** * Returns a pixel buffer of a suitable size to hold the given video frame . The
 * video size is taken either from the video metadata or by analyzing the
 * incoming video packet .
 * @ param firstFrame
 * @ return */
protected LoanerPicture getPixelBuffer ( ByteBuffer firstFrame ) { } }

implementation: VideoCodecMeta videoMeta = getVideoCodecMeta ( ) ; Size size = videoMeta . getSize ( ) ; return pixelStore . getPicture ( ( size . getWidth ( ) + 15 ) & ~ 0xf , ( size . getHeight ( ) + 15 ) & ~ 0xf , videoMeta . getColor ( ) ) ;


signature:
public class ProresEncoder { /** * Wrong usage of Javascript keyword : in */
private void dctOnePlane ( int blocksPerSlice , byte [ ] src , byte [ ] hibd , int [ ] dst ) { } }

implementation: for ( int i = 0 ; i < src . length ; i ++ ) { dst [ i ] = ( ( src [ i ] + 128 ) << 2 ) ; } if ( hibd != null ) { for ( int i = 0 ; i < src . length ; i ++ ) { dst [ i ] += hibd [ i ] ; } } for ( int i = 0 ; i < blocksPerSlice ; i ++ ) { fdctProres10 ( dst , i << 6 ) ; }


signature:
public class ProresEncoder { /** * Wrong usage of Javascript keyword : in */
private void split ( Picture src , Picture dst , int mbX , int mbY , int sliceMbCount , int vStep , int vOffset ) { } }

implementation: byte [ ] [ ] inData = src . getData ( ) ; byte [ ] [ ] inhbdData = src . getLowBits ( ) ; byte [ ] [ ] outData = dst . getData ( ) ; byte [ ] [ ] outhbdData = dst . getLowBits ( ) ; doSplit ( inData [ 0 ] , outData [ 0 ] , src . getPlaneWidth ( 0 ) , mbX , mbY , sliceMbCount , 0 , vStep , vOffset ) ; doSplit ( inData [ 1 ] , outData [ 1 ] , src . getPlaneWidth ( 1 ) , mbX , mbY , sliceMbCount , 1 , vStep , vOffset ) ; doSplit ( inData [ 2 ] , outData [ 2 ] , src . getPlaneWidth ( 2 ) , mbX , mbY , sliceMbCount , 1 , vStep , vOffset ) ; if ( src . getLowBits ( ) != null ) { doSplit ( inhbdData [ 0 ] , outhbdData [ 0 ] , src . getPlaneWidth ( 0 ) , mbX , mbY , sliceMbCount , 0 , vStep , vOffset ) ; doSplit ( inhbdData [ 1 ] , outhbdData [ 1 ] , src . getPlaneWidth ( 1 ) , mbX , mbY , sliceMbCount , 1 , vStep , vOffset ) ; doSplit ( inhbdData [ 2 ] , outhbdData [ 2 ] , src . getPlaneWidth ( 2 ) , mbX , mbY , sliceMbCount , 1 , vStep , vOffset ) ; }


signature:
public class GainControl { /** * gain compensation and overlap - add :
 * - the gain control function is calculated
 * - the gain control function applies to IMDCT output samples as a another IMDCT window
 * - the reconstructed time domain signal produces by overlap - add */
private void compensate ( float [ ] _in , float [ ] [ ] out , WindowSequence winSeq , int band ) { } }

implementation:
int j ; if ( winSeq . equals ( WindowSequence . EIGHT_SHORT_SEQUENCE ) ) { int a , b ; for ( int k = 0 ; k < 8 ; k ++ ) { // calculation
calculateFunctionData ( lbShort * 2 , band , winSeq , k ) ; // applying
for ( j = 0 ; j < lbShort * 2 ; j ++ ) { a = band * lbLong * 2 + k * lbShort * 2 + j ; _in [ a ] *= _function [ j ] ; } // overlapping
for ( j = 0 ; j < lbShort ; j ++ ) { a = j + lbLong * 7 / 16 + lbShort * k ; b = band * lbLong * 2 + k * lbShort * 2 + j ; overlap [ band ] [ a ] += _in [ b ] ; } // store for next frame
for ( j = 0 ; j < lbShort ; j ++ ) { a = j + lbLong * 7 / 16 + lbShort * ( k + 1 ) ; b = band * lbLong * 2 + k * lbShort * 2 + lbShort + j ; overlap [ band ] [ a ] = _in [ b ] ; } locationPrev [ band ] [ 0 ] = Platform . copyOfInt ( location [ band ] [ k ] , location [ band ] [ k ] . length ) ; levelPrev [ band ] [ 0 ] = Platform . copyOfInt ( level [ band ] [ k ] , level [ band ] [ k ] . length ) ; } arraycopy ( overlap [ band ] , 0 , out [ band ] , 0 , lbLong ) ; arraycopy ( overlap [ band ] , lbLong , overlap [ band ] , 0 , lbLong ) ; } else { // calculation
calculateFunctionData ( lbLong * 2 , band , winSeq , 0 ) ; // applying
for ( j = 0 ; j < lbLong * 2 ; j ++ ) { _in [ band * lbLong * 2 + j ] *= _function [ j ] ; } // overlapping
for ( j = 0 ; j < lbLong ; j ++ ) { out [ band ] [ j ] = overlap [ band ] [ j ] + _in [ band * lbLong * 2 + j ] ; } // store for next frame
for ( j = 0 ; j < lbLong ; j ++ ) { overlap [ band ] [ j ] = _in [ band * lbLong * 2 + lbLong + j ] ; } final int lastBlock = winSeq . equals ( WindowSequence . ONLY_LONG_SEQUENCE ) ? 1 : 0 ; locationPrev [ band ] [ 0 ] = Platform . copyOfInt ( location [ band ] [ lastBlock ] , location [ band ] [ lastBlock ] . length ) ; levelPrev [ band ] [ 0 ] = Platform . copyOfInt ( level [ band ] [ lastBlock ] , level [ band ] [ lastBlock ] . length ) ; }


signature:
public class GainControl { /** * produces gain control function data , stores it in ' function ' array */
private void calculateFunctionData ( int samples , int band , WindowSequence winSeq , int blockID ) { } }

implementation:
final int [ ] locA = new int [ 10 ] ; final float [ ] levA = new float [ 10 ] ; final float [ ] modFunc = new float [ samples ] ; final float [ ] buf1 = new float [ samples / 2 ] ; final float [ ] buf2 = new float [ samples / 2 ] ; final float [ ] buf3 = new float [ samples / 2 ] ; int maxLocGain0 = 0 , maxLocGain1 = 0 , maxLocGain2 = 0 ; switch ( winSeq ) { case ONLY_LONG_SEQUENCE : case EIGHT_SHORT_SEQUENCE : maxLocGain0 = maxLocGain1 = samples / 2 ; maxLocGain2 = 0 ; break ; case LONG_START_SEQUENCE : maxLocGain0 = samples / 2 ; maxLocGain1 = samples * 7 / 32 ; maxLocGain2 = samples / 16 ; break ; case LONG_STOP_SEQUENCE : maxLocGain0 = samples / 16 ; maxLocGain1 = samples * 7 / 32 ; maxLocGain2 = samples / 2 ; break ; } // calculate the fragment modification functions
// for the first half region
calculateFMD ( band , 0 , true , maxLocGain0 , samples , locA , levA , buf1 ) ; // for the latter half region
int block = ( winSeq . equals ( WindowSequence . EIGHT_SHORT_SEQUENCE ) ) ? blockID : 0 ; float secLevel = calculateFMD ( band , block , false , maxLocGain1 , samples , locA , levA , buf2 ) ; // for the non - overlapped region
if ( winSeq . equals ( WindowSequence . LONG_START_SEQUENCE ) || winSeq . equals ( WindowSequence . LONG_STOP_SEQUENCE ) ) { calculateFMD ( band , 1 , false , maxLocGain2 , samples , locA , levA , buf3 ) ; } // calculate a gain modification function
int i ; int flatLen = 0 ; if ( winSeq . equals ( WindowSequence . LONG_STOP_SEQUENCE ) ) { flatLen = samples / 2 - maxLocGain0 - maxLocGain1 ; for ( i = 0 ; i < flatLen ; i ++ ) { modFunc [ i ] = 1.0f ; } } if ( winSeq . equals ( WindowSequence . ONLY_LONG_SEQUENCE ) || winSeq . equals ( WindowSequence . EIGHT_SHORT_SEQUENCE ) ) levA [ 0 ] = 1.0f ; for ( i = 0 ; i < maxLocGain0 ; i ++ ) { modFunc [ i + flatLen ] = levA [ 0 ] * secLevel * buf1 [ i ] ; } for ( i = 0 ; i < maxLocGain1 ; i ++ ) { modFunc [ i + flatLen + maxLocGain0 ] = levA [ 0 ] * buf2 [ i ] ; } if ( winSeq . equals ( WindowSequence . LONG_START_SEQUENCE ) ) { for ( i = 0 ; i < maxLocGain2 ; i ++ ) { modFunc [ i + maxLocGain0 + maxLocGain1 ] = buf3 [ i ] ; } flatLen = samples / 2 - maxLocGain1 - maxLocGain2 ; for ( i = 0 ; i < flatLen ; i ++ ) { modFunc [ i + maxLocGain0 + maxLocGain1 + maxLocGain2 ] = 1.0f ; } } else if ( winSeq . equals ( WindowSequence . LONG_STOP_SEQUENCE ) ) { for ( i = 0 ; i < maxLocGain2 ; i ++ ) { modFunc [ i + flatLen + maxLocGain0 + maxLocGain1 ] = buf3 [ i ] ; } } // calculate a gain control function
for ( i = 0 ; i < samples ; i ++ ) { _function [ i ] = 1.0f / modFunc [ i ] ; }


signature:
public class GainControl { /** * calculates a fragment modification function by interpolating the gain
 * values of the gain change positions */
private float calculateFMD ( int bd , int wd , boolean prev , int maxLocGain , int samples , int [ ] loc , float [ ] lev , float [ ] fmd ) { } }

implementation:
final int [ ] m = new int [ samples / 2 ] ; final int [ ] lct = prev ? locationPrev [ bd ] [ wd ] : location [ bd ] [ wd ] ; final int [ ] lvl = prev ? levelPrev [ bd ] [ wd ] : level [ bd ] [ wd ] ; final int length = lct . length ; int lngain ; int i ; for ( i = 0 ; i < length ; i ++ ) { loc [ i + 1 ] = 8 * lct [ i ] ; // gainc
lngain = getGainChangePointID ( lvl [ i ] ) ; // gainc
if ( lngain < 0 ) lev [ i + 1 ] = 1.0f / ( float ) Math . pow ( 2 , - lngain ) ; else lev [ i + 1 ] = ( float ) Math . pow ( 2 , lngain ) ; } // set start point values
loc [ 0 ] = 0 ; if ( length == 0 ) lev [ 0 ] = 1.0f ; else lev [ 0 ] = lev [ 1 ] ; float secLevel = lev [ 0 ] ; // set end point values
loc [ length + 1 ] = maxLocGain ; lev [ length + 1 ] = 1.0f ; int j ; for ( i = 0 ; i < maxLocGain ; i ++ ) { m [ i ] = 0 ; for ( j = 0 ; j <= length + 1 ; j ++ ) { if ( loc [ j ] <= i ) m [ i ] = j ; } } for ( i = 0 ; i < maxLocGain ; i ++ ) { if ( ( i >= loc [ m [ i ] ] ) && ( i <= loc [ m [ i ] ] + 7 ) ) fmd [ i ] = interpolateGain ( lev [ m [ i ] ] , lev [ m [ i ] + 1 ] , i - loc [ m [ i ] ] ) ; else fmd [ i ] = lev [ m [ i ] + 1 ] ; } return secLevel ;


signature:
public class GainControl { /** * transformes the exponent value of the gain to the id of the gain change
 * point */
private int getGainChangePointID ( int lngain ) { } }

implementation: for ( int i = 0 ; i < ID_GAIN ; i ++ ) { if ( lngain == LN_GAIN [ i ] ) return i ; } return 0 ; // shouldn ' t happen


signature:
public class GainControl { /** * calculates a fragment modification function
 * the interpolated gain value between the gain values of two gain change
 * positions is calculated by the formula :
 * f ( a , b , j ) = 2 ^ ( ( ( 8 - j ) log2 ( a ) + j * log2 ( b ) ) / 8) */
private float interpolateGain ( float alev0 , float alev1 , int iloc ) { } }

implementation: final float a0 = ( float ) ( Math . log ( alev0 ) / Math . log ( 2 ) ) ; final float a1 = ( float ) ( Math . log ( alev1 ) / Math . log ( 2 ) ) ; return ( float ) Math . pow ( 2.0f , ( ( ( 8 - iloc ) * a0 + iloc * a1 ) / 8 ) ) ;


signature:
public class DataConvert { /** * Generic byte - array to integer - array conversion
 * Converts each depth - bit sequence from the input byte array into integer
 * @ param b
 * Input bytes
 * @ param depth
 * Bit depth of the integers
 * @ param isBe
 * If integers are big - endian or little - endian
 * @ return */
public static int [ ] fromByte ( byte [ ] b , int depth , boolean isBe ) { } }

implementation: if ( depth == 24 ) if ( isBe ) return from24BE ( b ) ; else return from24LE ( b ) ; else if ( depth == 16 ) if ( isBe ) return from16BE ( b ) ; else return from16LE ( b ) ; throw new NotSupportedException ( "Conversion from " + depth + "bit " + ( isBe ? "big endian" : "little endian" ) + " is not supported." ) ;


signature:
public class DataConvert { /** * Generic integer - array to byte - array conversion
 * Converts each integer into depth - bit sequence in the output byte array
 * @ param ia
 * Integer array
 * @ param depth
 * Bit depth of the integers
 * @ param isBe
 * If integers are big - endian or little - endian
 * @ return */
public static byte [ ] toByte ( int [ ] ia , int depth , boolean isBe ) { } }

implementation: if ( depth == 24 ) if ( isBe ) return to24BE ( ia ) ; else return to24LE ( ia ) ; else if ( depth == 16 ) if ( isBe ) return to16BE ( ia ) ; else return to16LE ( ia ) ; throw new NotSupportedException ( "Conversion to " + depth + "bit " + ( isBe ? "big endian" : "little endian" ) + " is not supported." ) ;


signature:
public class AudioUtil { /** * Converts PCM samples stored in buf and described with format to float
 * array representation
 * @ param format
 * Supported formats - * _ * _ S16 _ LE , * _ * _ S24 _ LE , * _ * _ S16 _ BE ,
 * * _ * _ S24 _ LE
 * @ param buf
 * @ param floatBuf
 * @ return Total number of samples read from the buffer */
public static void toFloat ( AudioFormat format , ByteBuffer buf , FloatBuffer floatBuf ) { } }

implementation: if ( ! format . isSigned ( ) ) throw new NotSupportedException ( "Unsigned PCM is not supported ( yet? )." ) ; if ( format . getSampleSizeInBits ( ) != 16 && format . getSampleSizeInBits ( ) != 24 ) throw new NotSupportedException ( format . getSampleSizeInBits ( ) + " bit PCM is not supported ( yet? )." ) ; if ( format . isBigEndian ( ) ) { if ( format . getSampleSizeInBits ( ) == 16 ) { toFloat16BE ( buf , floatBuf ) ; } else { toFloat24BE ( buf , floatBuf ) ; } } else { if ( format . getSampleSizeInBits ( ) == 16 ) { toFloat16LE ( buf , floatBuf ) ; } else { toFloat24LE ( buf , floatBuf ) ; } }


signature:
public class AudioUtil { /** * Converts float PCM samples stored in floatBuf to integer representation
 * according to format and stores them in buf
 * @ param format
 * Supported formats - * _ * _ S16 _ LE , * _ * _ S24 _ LE , * _ * _ S16 _ BE ,
 * * _ * _ S24 _ LE
 * @ param buf
 * @ param floatBuf
 * @ return Total number of samples written to the buffer */
public static void fromFloat ( FloatBuffer floatBuf , AudioFormat format , ByteBuffer buf ) { } }

implementation: if ( ! format . isSigned ( ) ) throw new NotSupportedException ( "Unsigned PCM is not supported ( yet? )." ) ; if ( format . getSampleSizeInBits ( ) != 16 && format . getSampleSizeInBits ( ) != 24 ) throw new NotSupportedException ( format . getSampleSizeInBits ( ) + " bit PCM is not supported ( yet? )." ) ; if ( format . isBigEndian ( ) ) { if ( format . getSampleSizeInBits ( ) == 16 ) { fromFloat16BE ( buf , floatBuf ) ; } else { fromFloat24BE ( buf , floatBuf ) ; } } else { if ( format . getSampleSizeInBits ( ) == 16 ) { fromFloat16LE ( buf , floatBuf ) ; } else { fromFloat24LE ( buf , floatBuf ) ; } }


signature:
public class AudioUtil { /** * Interleaves audio samples in ins into outb using sample size from the
 * format
 * @ param format
 * @ param ins
 * @ param outb */
public static void interleave ( AudioFormat format , ByteBuffer [ ] ins , ByteBuffer outb ) { } }

implementation: int bytesPerSample = format . getSampleSizeInBits ( ) >> 3 ; int bytesPerFrame = bytesPerSample * ins . length ; int max = 0 ; for ( int i = 0 ; i < ins . length ; i ++ ) if ( ins [ i ] . remaining ( ) > max ) max = ins [ i ] . remaining ( ) ; for ( int frames = 0 ; frames < max && outb . remaining ( ) >= bytesPerFrame ; frames ++ ) { for ( int j = 0 ; j < ins . length ; j ++ ) { if ( ins [ j ] . remaining ( ) < bytesPerSample ) { for ( int i = 0 ; i < bytesPerSample ; i ++ ) outb . put ( ( byte ) 0 ) ; } else { for ( int i = 0 ; i < bytesPerSample ; i ++ ) { outb . put ( ins [ j ] . get ( ) ) ; } } } }


signature:
public class AudioUtil { /** * Deinterleaves audio samples from inb into outs using sample size from
 * format
 * @ param format
 * @ param inb
 * @ param outs */
public static void deinterleave ( AudioFormat format , ByteBuffer inb , ByteBuffer [ ] outs ) { } }

implementation: int bytesPerSample = format . getSampleSizeInBits ( ) >> 3 ; int bytesPerFrame = bytesPerSample * outs . length ; while ( inb . remaining ( ) >= bytesPerFrame ) { for ( int j = 0 ; j < outs . length ; j ++ ) { for ( int i = 0 ; i < bytesPerSample ; i ++ ) { outs [ j ] . put ( inb . get ( ) ) ; } } }


signature:
public class TrakBox { /** * Retrieves coded size of this video track .
 * Note : May be different from video display dimension .
 * @ return */
public Size getCodedSize ( ) { } }

implementation: SampleEntry se = getSampleEntries ( ) [ 0 ] ; if ( ! ( se instanceof VideoSampleEntry ) ) throw new IllegalArgumentException ( "Not a video track" ) ; VideoSampleEntry vse = ( VideoSampleEntry ) se ; return new Size ( vse . getWidth ( ) , vse . getHeight ( ) ) ;


implementation: int picSizeInMbs = picWidthInMbs * picHeightInMbs ; int [ ] groups = new int [ picSizeInMbs ] ; for ( int i = 0 ; i < picSizeInMbs ; i ++ ) { int group = ( ( i % picWidthInMbs ) + ( ( ( i / picWidthInMbs ) * numSliceGroups ) / 2 ) ) % numSliceGroups ; groups [ i ] = group ; } return groups ;


signature:
public class SliceGroupMapBuilder { /** * A boxout macroblock to slice group mapping . Only applicable when there ' s
 * exactly 2 slice groups . Slice group 1 is a background , while slice group
 * 0 is a box in the middle of the frame .
 * @ param picWidthInMbs
 * @ param picHeightInMbs
 * @ param changeDirection
 * @ param numberOfMbsInBox
 * number of macroblocks in slice group 0
 * @ return */
public static int [ ] buildBoxOutMap ( int picWidthInMbs , int picHeightInMbs , boolean changeDirection , int numberOfMbsInBox ) { } }

implementation: int picSizeInMbs = picWidthInMbs * picHeightInMbs ; int [ ] groups = new int [ picSizeInMbs ] ; int changeDirectionInt = changeDirection ? 1 : 0 ; for ( int i = 0 ; i < picSizeInMbs ; i ++ ) groups [ i ] = 1 ; int x = ( picWidthInMbs - changeDirectionInt ) / 2 ; int y = ( picHeightInMbs - changeDirectionInt ) / 2 ; int leftBound = x ; int topBound = y ; int rightBound = x ; int bottomBound = y ; int xDir = changeDirectionInt - 1 ; int yDir = changeDirectionInt ; boolean mapUnitVacant = false ; for ( int k = 0 ; k < numberOfMbsInBox ; k += ( mapUnitVacant ? 1 : 0 ) ) { int mbAddr = y * picWidthInMbs + x ; mapUnitVacant = ( groups [ mbAddr ] == 1 ) ; if ( mapUnitVacant ) { groups [ mbAddr ] = 0 ; } if ( xDir == - 1 && x == leftBound ) { leftBound = Max ( leftBound - 1 , 0 ) ; x = leftBound ; xDir = 0 ; yDir = 2 * changeDirectionInt - 1 ; } else if ( xDir == 1 && x == rightBound ) { rightBound = Min ( rightBound + 1 , picWidthInMbs - 1 ) ; x = rightBound ; xDir = 0 ; yDir = 1 - 2 * changeDirectionInt ; } else if ( yDir == - 1 && y == topBound ) { topBound = Max ( topBound - 1 , 0 ) ; y = topBound ; xDir = 1 - 2 * changeDirectionInt ; yDir = 0 ; } else if ( yDir == 1 && y == bottomBound ) { bottomBound = Min ( bottomBound + 1 , picHeightInMbs - 1 ) ; y = bottomBound ; xDir = 2 * changeDirectionInt - 1 ; yDir = 0 ; } else { x += xDir ; y += yDir ; } } return groups ;


signature:
public class SliceGroupMapBuilder { /** * A macroblock to slice group map that fills frame column by column
 * @ param picWidthInMbs
 * @ param picHeightInMbs
 * @ param sizeOfUpperLeftGroup
 * @ param changeDirection
 * @ return */
public static int [ ] buildWipeMap ( int picWidthInMbs , int picHeightInMbs , int sizeOfUpperLeftGroup , boolean changeDirection ) { } }

implementation: int picSizeInMbs = picWidthInMbs * picHeightInMbs ; int [ ] groups = new int [ picSizeInMbs ] ; int changeDirectionInt = changeDirection ? 1 : 0 ; int k = 0 ; for ( int j = 0 ; j < picWidthInMbs ; j ++ ) { for ( int i = 0 ; i < picHeightInMbs ; i ++ ) { int mbAddr = i * picWidthInMbs + j ; if ( k ++ < sizeOfUpperLeftGroup ) { groups [ mbAddr ] = changeDirectionInt ; } else { groups [ mbAddr ] = 1 - changeDirectionInt ; } } } return groups ;


signature:
public class MXFMetadata { /** * Utility method to read a batch of ULS
 * @ param _ bb
 * @ return */
protected static UL [ ] readULBatch ( ByteBuffer _bb ) { } }

implementation: int count = _bb . getInt ( ) ; _bb . getInt ( ) ; UL [ ] result = new UL [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { result [ i ] = UL . read ( _bb ) ; } return result ;


signature:
public class MXFMetadata { /** * Utility method to read a batch of int32
 * @ param _ bb
 * @ return */
protected static int [ ] readInt32Batch ( ByteBuffer _bb ) { } }

implementation: int count = _bb . getInt ( ) ; _bb . getInt ( ) ; int [ ] result = new int [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { result [ i ] = _bb . getInt ( ) ; } return result ;


signature:
public class AWTFrameGrab { /** * Get frame at a specified second as AWT image
 * @ param file
 * @ param second
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static BufferedImage getFrame ( File file , double second ) throws IOException , JCodecException { } }

implementation: FileChannelWrapper ch = null ; try { ch = NIOUtils . readableChannel ( file ) ; return ( ( AWTFrameGrab ) createAWTFrameGrab ( ch ) . seekToSecondPrecise ( second ) ) . getFrameWithOrientation ( ) ; } finally { NIOUtils . closeQuietly ( ch ) ; }


signature:
public class AWTFrameGrab { /** * Get frame at a specified second as AWT image
 * @ param file
 * @ param second
 * @ return
 * @ throws UnsupportedFormatException
 * @ throws IOException */
public static BufferedImage getFrame ( SeekableByteChannel file , double second ) throws JCodecException , IOException { } }

implementation: return ( ( AWTFrameGrab ) createAWTFrameGrab ( file ) . seekToSecondPrecise ( second ) ) . getFrame ( ) ;


signature:
public class AWTFrameGrab { /** * Get frame at current position in AWT image
 * @ return
 * @ throws IOException */
public BufferedImage getFrame ( ) throws IOException { } }

implementation: Picture nativeFrame = getNativeFrame ( ) ; return nativeFrame == null ? null : AWTUtil . toBufferedImage ( nativeFrame ) ;


signature:
public class AWTFrameGrab { /** * Get frame at a specified frame number as AWT image
 * @ param file
 * @ param second
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static BufferedImage getFrame ( File file , int frameNumber ) throws IOException , JCodecException { } }

implementation: FileChannelWrapper ch = null ; try { ch = NIOUtils . readableChannel ( file ) ; return ( ( AWTFrameGrab ) createAWTFrameGrab ( ch ) . seekToFramePrecise ( frameNumber ) ) . getFrame ( ) ; } finally { NIOUtils . closeQuietly ( ch ) ; }


signature:
public class AWTFrameGrab { /** * Get frame at a specified frame number as AWT image
 * @ param file
 * @ param second
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static BufferedImage getFrame ( SeekableByteChannel file , int frameNumber ) throws JCodecException , IOException { } }

implementation: return ( ( AWTFrameGrab ) createAWTFrameGrab ( file ) . seekToFramePrecise ( frameNumber ) ) . getFrame ( ) ;


signature:
public class AWTFrameGrab { /** * Get a specified frame by number from an already open demuxer track
 * @ param vt
 * @ param decoder
 * @ param frameNumber
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static BufferedImage getFrame ( SeekableDemuxerTrack vt , ContainerAdaptor decoder , int frameNumber ) throws IOException , JCodecException { } }

implementation: return ( ( AWTFrameGrab ) new AWTFrameGrab ( vt , decoder ) . seekToFramePrecise ( frameNumber ) ) . getFrame ( ) ;


signature:
public class AWTFrameGrab { /** * Get a specified frame by second from an already open demuxer track
 * @ param vt
 * @ param decoder
 * @ param frameNumber
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static BufferedImage getFrame ( SeekableDemuxerTrack vt , ContainerAdaptor decoder , double second ) throws IOException , JCodecException { } }

implementation: return ( ( AWTFrameGrab ) new AWTFrameGrab ( vt , decoder ) . seekToSecondPrecise ( second ) ) . getFrame ( ) ;


signature:
public class AWTFrameGrab { /** * Get a specified frame by number from an already open demuxer track (
 * sloppy mode , i . e . nearest keyframe )
 * @ param vt
 * @ param decoder
 * @ param frameNumber
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static BufferedImage getFrameSloppy ( SeekableDemuxerTrack vt , ContainerAdaptor decoder , int frameNumber ) throws IOException , JCodecException { } }

implementation: return ( ( AWTFrameGrab ) new AWTFrameGrab ( vt , decoder ) . seekToFrameSloppy ( frameNumber ) ) . getFrame ( ) ;


signature:
public class AWTFrameGrab { /** * Get a specified frame by second from an already open demuxer track (
 * sloppy mode , i . e . nearest keyframe )
 * @ param vt
 * @ param decoder
 * @ param frameNumber
 * @ return
 * @ throws IOException
 * @ throws JCodecException */
public static BufferedImage getFrameSloppy ( SeekableDemuxerTrack vt , ContainerAdaptor decoder , double second ) throws IOException , JCodecException { } }

implementation: return ( ( AWTFrameGrab ) new AWTFrameGrab ( vt , decoder ) . seekToSecondSloppy ( second ) ) . getFrame ( ) ;


signature:
public class MPEGAudioDemuxer { /** * Used to auto - detect MPEG Audio ( MP3 ) files
 * @ param b
 * Buffer containing a snippet of data
 * @ return Score from 0 to 100 */
@ UsedViaReflection public static int probe ( final ByteBuffer b ) { } }

implementation: ByteBuffer fork = b . duplicate ( ) ; int valid = 0 , total = 0 ; int header = fork . getInt ( ) ; do { if ( ! validHeader ( header ) ) header = skipJunkBB ( header , fork ) ; int size = calcFrameSize ( header ) ; if ( fork . remaining ( ) < size ) break ; ++ total ; if ( size > 0 ) NIOUtils . skip ( fork , size - 4 ) ; else header = skipJunkBB ( header , fork ) ; if ( fork . remaining ( ) >= 4 ) { header = fork . getInt ( ) ; if ( size >= MIN_FRAME_SIZE && size <= MAX_FRAME_SIZE && validHeader ( header ) ) valid ++ ; } } while ( fork . remaining ( ) >= 4 ) ; return ( 100 * valid ) / total ;


signature:
public class MBlockDecoderUtils { /** * Calculates median prediction
 * @ param a , b , c and d are packed motion vectors */
public static int calcMVPredictionMedian ( int a , int b , int c , int d , boolean aAvb , boolean bAvb , boolean cAvb , boolean dAvb , int ref , int comp ) { } }

implementation: if ( ! cAvb ) { c = d ; cAvb = dAvb ; } if ( aAvb && ! bAvb && ! cAvb ) { b = c = a ; bAvb = cAvb = aAvb ; } a = aAvb ? a : NULL_VECTOR ; b = bAvb ? b : NULL_VECTOR ; c = cAvb ? c : NULL_VECTOR ; if ( mvRef ( a ) == ref && mvRef ( b ) != ref && mvRef ( c ) != ref ) return mvC ( a , comp ) ; else if ( mvRef ( b ) == ref && mvRef ( a ) != ref && mvRef ( c ) != ref ) return mvC ( b , comp ) ; else if ( mvRef ( c ) == ref && mvRef ( a ) != ref && mvRef ( b ) != ref ) return mvC ( c , comp ) ; return mvC ( a , comp ) + mvC ( b , comp ) + mvC ( c , comp ) - min ( mvC ( a , comp ) , mvC ( b , comp ) , mvC ( c , comp ) ) - max ( mvC ( a , comp ) , mvC ( b , comp ) , mvC ( c , comp ) ) ;


signature:
public class VPXBitstream { /** * Encodes DCT / WHT coefficients into the provided instance of a boolean
 * encoder
 * @ param bc
 * @ param coeffs */
public void encodeCoeffs ( VPXBooleanEncoder bc , int [ ] coeffs , int firstCoeff , int nCoeff , int blkType , int ctx ) { } }

implementation: boolean prevZero = false ; int i ; for ( i = firstCoeff ; i < nCoeff ; i ++ ) { int [ ] probs = tokenBinProbs [ blkType ] [ coeffBandMapping [ i ] ] [ ctx ] ; int coeffAbs = MathUtil . abs ( coeffs [ i ] ) ; if ( ! prevZero ) bc . writeBit ( probs [ 0 ] , 1 ) ; if ( coeffAbs == 0 ) { bc . writeBit ( probs [ 1 ] , 0 ) ; ctx = 0 ; } else { bc . writeBit ( probs [ 1 ] , 1 ) ; if ( coeffAbs == 1 ) { bc . writeBit ( probs [ 2 ] , 0 ) ; ctx = 1 ; } else { ctx = 2 ; bc . writeBit ( probs [ 2 ] , 1 ) ; if ( coeffAbs <= 4 ) { bc . writeBit ( probs [ 3 ] , 0 ) ; if ( coeffAbs == 2 ) bc . writeBit ( probs [ 4 ] , 0 ) ; else { bc . writeBit ( probs [ 4 ] , 1 ) ; bc . writeBit ( probs [ 5 ] , coeffAbs - 3 ) ; } } else { bc . writeBit ( probs [ 3 ] , 1 ) ; if ( coeffAbs <= 10 ) { bc . writeBit ( probs [ 6 ] , 0 ) ; if ( coeffAbs <= 6 ) { bc . writeBit ( probs [ 7 ] , 0 ) ; bc . writeBit ( 159 , coeffAbs - 5 ) ; } else { bc . writeBit ( probs [ 7 ] , 1 ) ; int d = coeffAbs - 7 ; bc . writeBit ( 165 , d >> 1 ) ; bc . writeBit ( 145 , d & 1 ) ; } } else { bc . writeBit ( probs [ 6 ] , 1 ) ; if ( coeffAbs <= 34 ) { bc . writeBit ( probs [ 8 ] , 0 ) ; if ( coeffAbs <= 18 ) { bc . writeBit ( probs [ 9 ] , 0 ) ; writeCat3Ext ( bc , coeffAbs ) ; } else { bc . writeBit ( probs [ 9 ] , 1 ) ; writeCat4Ext ( bc , coeffAbs ) ; } } else { bc . writeBit ( probs [ 8 ] , 1 ) ; if ( coeffAbs <= 66 ) { bc . writeBit ( probs [ 10 ] , 0 ) ; writeCatExt ( bc , coeffAbs , 35 , VPXConst . probCoeffExtCat5 ) ; } else { bc . writeBit ( probs [ 10 ] , 1 ) ; writeCatExt ( bc , coeffAbs , 67 , VPXConst . probCoeffExtCat6 ) ; } } } } } bc . writeBit ( 128 , MathUtil . sign ( coeffs [ i ] ) ) ; } prevZero = coeffAbs == 0 ; } if ( nCoeff < 16 ) { int [ ] probs = tokenBinProbs [ blkType ] [ coeffBandMapping [ i ] ] [ ctx ] ; bc . writeBit ( probs [ 0 ] , 0 ) ; }


signature:
public class SeqParameterSet { /** * Wrong usage of Javascript keyword : in */
public static int [ ] readScalingList ( BitReader src , int sizeOfScalingList ) { } }

implementation: int [ ] scalingList = new int [ sizeOfScalingList ] ; int lastScale = 8 ; int nextScale = 8 ; for ( int j = 0 ; j < sizeOfScalingList ; j ++ ) { if ( nextScale != 0 ) { int deltaScale = readSE ( src , "deltaScale" ) ; nextScale = ( lastScale + deltaScale + 256 ) % 256 ; if ( j == 0 && nextScale == 0 ) return null ; } scalingList [ j ] = nextScale == 0 ? lastScale : nextScale ; lastScale = scalingList [ j ] ; } return scalingList ;


signature:
public class SeqParameterSet { /** * Wrong usage of Javascript keyword : in */
private static void readScalingListMatrix ( BitReader src , SeqParameterSet sps ) { } }

implementation: sps . scalingMatrix = new int [ 8 ] [ ] ; for ( int i = 0 ; i < 8 ; i ++ ) { boolean seqScalingListPresentFlag = readBool ( src , "SPS: seqScalingListPresentFlag" ) ; if ( seqScalingListPresentFlag ) { int scalingListSize = i < 6 ? 16 : 64 ; sps . scalingMatrix [ i ] = readScalingList ( src , scalingListSize ) ; } }


signature:
public class H264Encoder { /** * Encode this picture into h . 264 frame . Frame type will be selected by
 * encoder . */
public EncodedFrame encodeFrame ( Picture pic , ByteBuffer _out ) { } }

implementation: if ( pic . getColor ( ) != ColorSpace . YUV420J ) throw new IllegalArgumentException ( "Input picture color is not supported: " + pic . getColor ( ) ) ; if ( frameNumber >= keyInterval ) { frameNumber = 0 ; } SliceType sliceType = frameNumber == 0 ? SliceType . I : SliceType . P ; boolean idr = frameNumber == 0 ; ByteBuffer data = doEncodeFrame ( pic , _out , idr , frameNumber ++ , sliceType ) ; return new EncodedFrame ( data , idr ) ;


signature:
public class H264Encoder { /** * Encode this picture as an IDR frame . IDR frame starts a new independently
 * decodeable video sequence
 * @ param pic
 * @ param _ out
 * @ return */
public ByteBuffer encodeIDRFrame ( Picture pic , ByteBuffer _out ) { } }

implementation: frameNumber = 0 ; return doEncodeFrame ( pic , _out , true , frameNumber , SliceType . I ) ;


signature:
public class H264Encoder { /** * Encode this picture as a P - frame . P - frame is an frame predicted from one
 * or more of the previosly decoded frame and is usually 10x less in size
 * then the IDR frame .
 * @ param pic
 * @ param _ out
 * @ return */
public ByteBuffer encodePFrame ( Picture pic , ByteBuffer _out ) { } }

implementation: frameNumber ++ ; return doEncodeFrame ( pic , _out , true , frameNumber , SliceType . P ) ;


signature:
public class Configurable { /** * Returns the name of the numbered property . < br >
 * < br >
 * @ param propertyNo The property number in the options list . < br >
 * < br >
 * @ return a Property value for this properties meta - data */
public Property getPropertyMetaData ( int propertyNo ) { } }

implementation: long cPtr = VideoJNI . Configurable_getPropertyMetaData__SWIG_0 ( swigCPtr , this , propertyNo ) ; return ( cPtr == 0 ) ? null : new Property ( cPtr , false ) ;


signature:
public class Configurable { /** * Returns the name of the named property . < br >
 * < br >
 * @ param name The property name . < br >
 * < br >
 * @ return a Property value for this properties meta - data < br >
 * @ throws PropertyNotFoundException if this property is not found . */
public Property getPropertyMetaData ( String name ) { } }

implementation: long cPtr = VideoJNI . Configurable_getPropertyMetaData__SWIG_1 ( swigCPtr , this , name ) ; return ( cPtr == 0 ) ? null : new Property ( cPtr , false ) ;


signature:
public class Configurable { /** * Sets a property on this Object . < br >
 * < br >
 * All AVOptions supported by the underlying AVClass are supported . < br >
 * < br >
 * @ param name The property name . For example " b " for bit - rate . < br >
 * @ param value The value of the property . < br >
 * < br >
 * @ throws PropertyNotFoundException if this property is not found . */
public void setProperty ( String name , String value ) { } }

implementation: VideoJNI . Configurable_setProperty__SWIG_0 ( swigCPtr , this , name , value ) ;


signature:
public class Configurable { /** * Looks up the property ' name ' and sets the < br >
 * value of the property to ' value ' . < br >
 * < br >
 * @ param name name of option < br >
 * @ param value Value of option < br >
 * < br >
 * @ throws PropertyNotFoundException if this property is not found . */
public void setProperty ( String name , Rational value ) { } }

implementation: VideoJNI . Configurable_setProperty__SWIG_4 ( swigCPtr , this , name , Rational . getCPtr ( value ) , value ) ;


signature:
public class Configurable { /** * Gets the value of this property , and returns as an Rational ; < br >
 * < br >
 * @ param name name of option < br >
 * < br >
 * @ return long value of property . < br >
 * < br >
 * @ throws PropertyNotFoundException if this property is not found . */
public Rational getPropertyAsRational ( String name ) { } }

implementation: long cPtr = VideoJNI . Configurable_getPropertyAsRational ( swigCPtr , this , name ) ; return ( cPtr == 0 ) ? null : new Rational ( cPtr , false ) ;


signature:
public class Configurable { /** * Sets all properties in valuesToSet on this Configurable object . < br >
 * < br >
 * @ param valuesToSet The set of key - value pairs to try to set < br >
 * @ param valuesNotFound If non null will contain all key - values pairs in valuesToSet < br >
 * that were not found in context . */
public void setProperty ( KeyValueBag valuesToSet , KeyValueBag valuesNotFound ) { } }

implementation: VideoJNI . Configurable_setProperty__SWIG_5 ( swigCPtr , this , KeyValueBag . getCPtr ( valuesToSet ) , valuesToSet , KeyValueBag . getCPtr ( valuesNotFound ) , valuesNotFound ) ;