📄 img_mpeg2_vld_inter.h
字号:
/* ======================================================================== */
/* TEXAS INSTRUMENTS, INC. */
/* */
/* IMGLIB DSP Image/Video Processing Library */
/* */
/* Release: Revision 1.04b */
/* CVS Revision: 1.11 Sun Sep 29 03:32:26 2002 (UTC) */
/* Snapshot date: 23-Oct-2003 */
/* */
/* This library contains proprietary intellectual property of Texas */
/* Instruments, Inc. The library and its source code are protected by */
/* various copyrights, and portions may also be protected by patents or */
/* other legal protections. */
/* */
/* This software is licensed for use with Texas Instruments TMS320 */
/* family DSPs. This license was provided to you prior to installing */
/* the software. You may review this license by consulting the file */
/* TI_license.PDF which accompanies the files in this library. */
/* ------------------------------------------------------------------------ */
/* Copyright (C) 2003 Texas Instruments, Incorporated. */
/* All Rights Reserved. */
/* ======================================================================== */
/* ======================================================================== */
/* Assembler compatibility shim for assembling 4.30 and later code on */
/* tools prior to 4.30. */
/* ======================================================================== */
/* ======================================================================== */
/* End of assembler compatibility shim. */
/* ======================================================================== */
/* ======================================================================== */
/* TEXAS INSTRUMENTS, INC. */
/* */
/* NAME */
/* IMG_mpeg2_vld_inter */
/* */
/* PLATFORM */
/* C6400 */
/* */
/* REVISION DATE */
/* 23-May-2002 */
/* */
/* DESCRIPTION */
/* This routine takes a bitstream of an MPEG-2 non-intra coded */
/* macroblock and returns the decoded IDCT coefficients. The routine */
/* is implemented as specified in the MPEG-2 standard text (ISO/IEC */
/* 13818-2). The routine checks the coded block pattern (cbp), */
/* performs coefficient decoding inlcuding, variable length decode, */
/* run-length expansion, inverse zigzag, dequantization, saturation */
/* and mismatch control. */
/* */
/* USAGE */
/* This routine is C callable, and has the following C prototype: */
/* */
/* void IMG_mpeg2_vld_inter */
/* ( */
/* const short *restrict Wptr, */
/* short *restrict outi, */
/* IMG_mpeg2_vld *restrict Mpeg2v, */
/* int mode_12Q4, */
/* int num_blocks, */
/* int bsbuf_words */
/* ); */
/* */
/* Wptr: Pointer to array that contains quantization matrix. The */
/* elements of the quantization matrix in *Wptr must be */
/* ordered according to the scan pattern used (zigzag or */
/* alternate scan). Video format 4:2:0 requires one */
/* quantization matrix (64 array elements). For formats */
/* 4:2:2 and 4:4:4 two quantization matrices (one for luma */
/* and one for chroma) must specified in the array (128 */
/* array elements). */
/* */
/* outi: Pointer to the IDCT coefficients output array */
/* (6*64 elements), elements must be set to zero prior to */
/* function call. */
/* */
/* Mpeg2v: Pointer to the context object containing the coding */
/* parameters of the MB to be decoded and the current state */
/* of the bitstream buffer. The structure is described */
/* below. */
/* */
/* mode_12Q4: 0: Coefficients are returned in normal 16-bit integer */
/* format. */
/* Otherwise: Coefficients are returned in 12Q4 format */
/* (normal 16-bit integer format left shifted by 4). This */
/* mode is useful for directly passing the coefficients */
/* into the IMG_idct_8x8 routine. */
/* */
/* num_blocks: Number of blocks that the MB contains. Valid values are */
/* 6 for 4:2:0, 8 for 4:2:2 and 12 for 4:4:4 format. */
/* */
/* bsbuf_words: Size of bitstream buffer in words. Must be a power of 2. */
/* Bitstream buffer must be aligned at an address boundary */
/* equal to its size in bytes (bitstream buffer is */
/* addressed circularly by this routine.) */
/* */
/* The structure Mpeg2v is defined as follows: */
/* */
/* #ifndef IMG_MPEG2_VLD_STRUCT_ */
/* #define IMG_MPEG2_VLD_STRUCT_ 1 */
/* */
/* typedef struct { */
/* unsigned int *bsbuf; // pointer to bitstream buffer */
/* unsigned int next_wptr; // next word to read from buffer */
/* unsigned int bptr; // bit position within word */
/* unsigned int word1; // word aligned buffer */
/* unsigned int word2; // word aligned buffer */
/* unsigned int top0; // top 32 bits of bitstream */
/* unsigned int top1; // next 32 bits of bitstream */
/* const unsigned char *scan; // inverse zigzag scan matrix */
/* unsigned int intravlc; // intra_vlc_format */
/* unsigned int quant_scale; // quant_scale */
/* unsigned int dc_prec; // intra_dc_precision */
/* unsigned int cbp; // coded_block_pattern */
/* unsigned int fault; // fault condition (returned) */
/* unsigned int reserved; // reserved */
/* } IMG_mpeg2_vld; */
/* */
/* #endif */
/* */
/* The Mpeg2v variables should have a fixed layout since they are */
/* accessed by this routine. If the layout is changed, the */
/* corresponding changes have to be made in the assembly code too. */
/* */
/* The routine sets the fault flag Mpeg2v.fault to 1 if an invalid */
/* VLC code was encountered or the total run went beyond 63. In */
/* theses cases the decoder has to resynchronize. */
/* */
/* The required lookup tables for this routine are provided in */
/* IMGLIB and are linked in automatically when linking against */
/* IMGLIB. */
/* */
/* Before calling the routine the bitstream varaibles in Mpeg2v */
/* have to be initialized. If bsbuf is a circular buffer and bsptr */
/* contains the number of bits in the buffer that already have */
/* been consumed, then next_wptr, bptr, word1, word2, top0 and */
/* top1 are initialized as follows: */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -