10c1bc742181ded4930842b46e9507372f0b1b963James Dong/** 20c1bc742181ded4930842b46e9507372f0b1b963James Dong * 30c1bc742181ded4930842b46e9507372f0b1b963James Dong * File Name: omxVCM4P2_DecodeVLCZigzag_IntraACVLC.c 40c1bc742181ded4930842b46e9507372f0b1b963James Dong * OpenMAX DL: v1.0.2 50c1bc742181ded4930842b46e9507372f0b1b963James Dong * Revision: 9641 60c1bc742181ded4930842b46e9507372f0b1b963James Dong * Date: Thursday, February 7, 2008 70c1bc742181ded4930842b46e9507372f0b1b963James Dong * 80c1bc742181ded4930842b46e9507372f0b1b963James Dong * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. 90c1bc742181ded4930842b46e9507372f0b1b963James Dong * 100c1bc742181ded4930842b46e9507372f0b1b963James Dong * 110c1bc742181ded4930842b46e9507372f0b1b963James Dong * 120c1bc742181ded4930842b46e9507372f0b1b963James Dong * Description: 130c1bc742181ded4930842b46e9507372f0b1b963James Dong * Contains modules for zigzag scanning and VLC decoding 140c1bc742181ded4930842b46e9507372f0b1b963James Dong * for intra block. 150c1bc742181ded4930842b46e9507372f0b1b963James Dong * 160c1bc742181ded4930842b46e9507372f0b1b963James Dong */ 170c1bc742181ded4930842b46e9507372f0b1b963James Dong 180c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "omxtypes.h" 190c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armOMX.h" 200c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "omxVC.h" 210c1bc742181ded4930842b46e9507372f0b1b963James Dong 220c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armVC.h" 230c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armCOMM.h" 240c1bc742181ded4930842b46e9507372f0b1b963James Dong 250c1bc742181ded4930842b46e9507372f0b1b963James Dong 260c1bc742181ded4930842b46e9507372f0b1b963James Dong 270c1bc742181ded4930842b46e9507372f0b1b963James Dong/** 280c1bc742181ded4930842b46e9507372f0b1b963James Dong * Function: omxVCM4P2_DecodeVLCZigzag_IntraACVLC (6.2.5.2.2) 290c1bc742181ded4930842b46e9507372f0b1b963James Dong * 300c1bc742181ded4930842b46e9507372f0b1b963James Dong * Description: 310c1bc742181ded4930842b46e9507372f0b1b963James Dong * Performs VLC decoding and inverse zigzag scan of AC and DC coefficients 320c1bc742181ded4930842b46e9507372f0b1b963James Dong * for one intra block. Two versions of the function (DCVLC and ACVLC) are 330c1bc742181ded4930842b46e9507372f0b1b963James Dong * provided in order to support the two different methods of processing DC 340c1bc742181ded4930842b46e9507372f0b1b963James Dong * coefficients, as described in [ISO14496-2], subclause 7.4.1.4, Intra DC 350c1bc742181ded4930842b46e9507372f0b1b963James Dong * Coefficient Decoding for the Case of Switched VLC Encoding. 360c1bc742181ded4930842b46e9507372f0b1b963James Dong * 370c1bc742181ded4930842b46e9507372f0b1b963James Dong * Input Arguments: 380c1bc742181ded4930842b46e9507372f0b1b963James Dong * 390c1bc742181ded4930842b46e9507372f0b1b963James Dong * ppBitStream - pointer to the pointer to the current byte in the 400c1bc742181ded4930842b46e9507372f0b1b963James Dong * bitstream buffer 410c1bc742181ded4930842b46e9507372f0b1b963James Dong * pBitOffset - pointer to the bit position in the current byte referenced 420c1bc742181ded4930842b46e9507372f0b1b963James Dong * by *ppBitStream. The parameter *pBitOffset is valid in the 430c1bc742181ded4930842b46e9507372f0b1b963James Dong * range [0-7]. Bit Position in one byte: |Most Least| *pBitOffset 440c1bc742181ded4930842b46e9507372f0b1b963James Dong * |0 1 2 3 4 5 6 7| 450c1bc742181ded4930842b46e9507372f0b1b963James Dong * predDir - AC prediction direction; used to select the zigzag scan 460c1bc742181ded4930842b46e9507372f0b1b963James Dong * pattern; takes one of the following values: OMX_VC_NONE - AC 470c1bc742181ded4930842b46e9507372f0b1b963James Dong * prediction not used; performs classical zigzag scan. 480c1bc742181ded4930842b46e9507372f0b1b963James Dong * OMX_VC_HORIZONTAL - Horizontal prediction; performs 490c1bc742181ded4930842b46e9507372f0b1b963James Dong * alternate-vertical zigzag scan; OMX_VC_VERTICAL - Vertical 500c1bc742181ded4930842b46e9507372f0b1b963James Dong * prediction; performs alternate-horizontal zigzag scan. 510c1bc742181ded4930842b46e9507372f0b1b963James Dong * shortVideoHeader - binary flag indicating presence of 520c1bc742181ded4930842b46e9507372f0b1b963James Dong * short_video_header; escape modes 0-3 are used if 530c1bc742181ded4930842b46e9507372f0b1b963James Dong * shortVideoHeader==0, and escape mode 4 is used when 540c1bc742181ded4930842b46e9507372f0b1b963James Dong * shortVideoHeader==1. 550c1bc742181ded4930842b46e9507372f0b1b963James Dong * videoComp - video component type (luminance or chrominance) of the 560c1bc742181ded4930842b46e9507372f0b1b963James Dong * current block 570c1bc742181ded4930842b46e9507372f0b1b963James Dong * 580c1bc742181ded4930842b46e9507372f0b1b963James Dong * Output Arguments: 590c1bc742181ded4930842b46e9507372f0b1b963James Dong * 600c1bc742181ded4930842b46e9507372f0b1b963James Dong * ppBitStream - *ppBitStream is updated after the block is decoded such 610c1bc742181ded4930842b46e9507372f0b1b963James Dong * that it points to the current byte in the bit stream buffer 620c1bc742181ded4930842b46e9507372f0b1b963James Dong * pBitOffset - *pBitOffset is updated such that it points to the current 630c1bc742181ded4930842b46e9507372f0b1b963James Dong * bit position in the byte pointed by *ppBitStream 640c1bc742181ded4930842b46e9507372f0b1b963James Dong * pDst - pointer to the coefficient buffer of current block; must be 650c1bc742181ded4930842b46e9507372f0b1b963James Dong * 4-byte aligned. 660c1bc742181ded4930842b46e9507372f0b1b963James Dong * 670c1bc742181ded4930842b46e9507372f0b1b963James Dong * Return Value: 680c1bc742181ded4930842b46e9507372f0b1b963James Dong * 690c1bc742181ded4930842b46e9507372f0b1b963James Dong * OMX_Sts_NoErr - no error 700c1bc742181ded4930842b46e9507372f0b1b963James Dong * OMX_Sts_BadArgErr - bad arguments At least one of the following 710c1bc742181ded4930842b46e9507372f0b1b963James Dong * pointers is NULL: ppBitStream, *ppBitStream, pBitOffset, pDst, 720c1bc742181ded4930842b46e9507372f0b1b963James Dong * or At least one of the following conditions is true: 730c1bc742181ded4930842b46e9507372f0b1b963James Dong * *pBitOffset exceeds [0,7], preDir exceeds [0,2], or pDst is 740c1bc742181ded4930842b46e9507372f0b1b963James Dong * not 4-byte aligned 750c1bc742181ded4930842b46e9507372f0b1b963James Dong * OMX_Sts_Err In DecodeVLCZigzag_IntraDCVLC, dc_size > 12 At least one of 760c1bc742181ded4930842b46e9507372f0b1b963James Dong * mark bits equals zero Illegal stream encountered; code cannot 770c1bc742181ded4930842b46e9507372f0b1b963James Dong * be located in VLC table Forbidden code encountered in the VLC 780c1bc742181ded4930842b46e9507372f0b1b963James Dong * FLC table The number of coefficients is greater than 64 790c1bc742181ded4930842b46e9507372f0b1b963James Dong * 800c1bc742181ded4930842b46e9507372f0b1b963James Dong */ 810c1bc742181ded4930842b46e9507372f0b1b963James Dong 820c1bc742181ded4930842b46e9507372f0b1b963James Dong 830c1bc742181ded4930842b46e9507372f0b1b963James DongOMXResult omxVCM4P2_DecodeVLCZigzag_IntraACVLC( 840c1bc742181ded4930842b46e9507372f0b1b963James Dong const OMX_U8 ** ppBitStream, 850c1bc742181ded4930842b46e9507372f0b1b963James Dong OMX_INT * pBitOffset, 860c1bc742181ded4930842b46e9507372f0b1b963James Dong OMX_S16 * pDst, 870c1bc742181ded4930842b46e9507372f0b1b963James Dong OMX_U8 predDir, 880c1bc742181ded4930842b46e9507372f0b1b963James Dong OMX_INT shortVideoHeader 890c1bc742181ded4930842b46e9507372f0b1b963James Dong) 900c1bc742181ded4930842b46e9507372f0b1b963James Dong{ 910c1bc742181ded4930842b46e9507372f0b1b963James Dong OMX_U8 start = 0; 920c1bc742181ded4930842b46e9507372f0b1b963James Dong 930c1bc742181ded4930842b46e9507372f0b1b963James Dong return armVCM4P2_DecodeVLCZigzag_Intra( 940c1bc742181ded4930842b46e9507372f0b1b963James Dong ppBitStream, 950c1bc742181ded4930842b46e9507372f0b1b963James Dong pBitOffset, 960c1bc742181ded4930842b46e9507372f0b1b963James Dong pDst, 970c1bc742181ded4930842b46e9507372f0b1b963James Dong predDir, 980c1bc742181ded4930842b46e9507372f0b1b963James Dong shortVideoHeader, 990c1bc742181ded4930842b46e9507372f0b1b963James Dong start); 1000c1bc742181ded4930842b46e9507372f0b1b963James Dong} 1010c1bc742181ded4930842b46e9507372f0b1b963James Dong 1020c1bc742181ded4930842b46e9507372f0b1b963James Dong/* End of file */ 1030c1bc742181ded4930842b46e9507372f0b1b963James Dong 104