Commit abad1723 authored by Lauros Pajunen's avatar Lauros Pajunen
Browse files

Add compact frame encoding

parent f986548d
Loading
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -3839,6 +3839,38 @@ ivas_error write_indices_ivas_fx(

    return error;
}
#ifdef IVAS_RTPDUMP


/*---------------------------------------------------------------------*
 * convertSerialToBytestream( )
 *
 * convert 16-bit short serial streams with 0x0000 and 0x0001 to a bytstream
 *---------------------------------------------------------------------*/

void convertSerialToBytestream_fx(
    const UWord16 *const serial, /* i  : input serial bitstream with values 0 and 1  */
    const UWord16 num_bits,      /* i  : number of bits in the input bitstream       */
    UWord8 *const bytestream     /* o  : output compact bitstream (bytestream)       */
)
{
    UWord32 i;
    UWord8 bit, bitinbyte;

    for ( i = 0; i < num_bits; ++i )
    {
        bit = ( serial[i] == 0x0001 ) ? 1 : 0;
        bitinbyte = bit << ( 7 - ( i & 0x7 ) );
        if ( !( i & 0x7 ) )
        {
            bytestream[i >> 3] = 0;
        }
        bytestream[i >> 3] |= bitinbyte;
    }

    return;
}
#endif


/*-------------------------------------------------------------------*
+8 −0
Original line number Diff line number Diff line
@@ -11189,6 +11189,14 @@ void ivas_set_bitstream_pointers(
Decoder_State **reset_elements(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure      */
);
#ifdef IVAS_RTPDUMP
void convertSerialToBytestream_fx(
    const UWord16 *const serial, /* i  : input serial bitstream with values 0 and 1  */
    const UWord16 num_bits,      /* i  : number of bits in the input bitstream       */
    UWord8 *const bytestream     /* o  : output compact bitstream (bytestream)       */
);
#endif
void mdct_switching_dec_fx(
    Decoder_State *st /* i/o: decoder state structure                 */