📄 omxicjp_dctquantfwdtableinit.c
字号:
/** * * File Name: omxICJP_DCTQuantFwdTableInit.c * OpenMAX DL: v1.0.2 * Revision: 10586 * Date: Wednesday, March 5, 2008 * * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. * * * * Description: * This file contains module for table initialization for IDCT * */#include "omxtypes.h"#include "armOMX.h"#include "omxIC.h"#include "armIC.h"#include "armCOMM.h"/** * Function: omxICJP_DCTQuantFwdTableInit (5.1.3.2.1) * * Description: * Initializes the JPEG DCT quantization table for 8-bit per component image * data. * * Input Arguments: * * pQuantRawTable - pointer to the raw quantization table; must be arranged * in raster scan order and aligned on an 8-byte boundary. The * table must contain 64 entries. Table entries should lie within * the range [1,255]. * * Output Arguments: * * pQuantFwdTable - pointer to the initialized quantization table; must be * aligned on an 8-byte boundary. The table must contain 64 * entries, and the implementation-specific contents must match the * table contents expected by the associated set of forward DCT * quantization functions in the same OpenMAX DL implementation, * including the functions DCTQuantFwd_S16, DCTQuantFwd_S16_I, and * DCTQuantFwd_Multiple_S16. * * Return Value: * * OMX_Sts_NoErr - no error * OMX_Sts_BadArgErr - Bad arguments. Returned for any of the following * conditions: a pointer was NULL the start address of a pointer * was not 8-byte aligned. * - one or more of the entries is equal to 0 in the table referenced * by pQuantRawTable. * */OMXResult omxICJP_DCTQuantFwdTableInit( const OMX_U8 *pQuantRawTable, OMX_U16 *pQuantFwdTable ){ OMX_INT i,j; OMX_F64 coef; /* Argument Checks */ armRetArgErrIf( pQuantRawTable == NULL, OMX_Sts_BadArgErr) armRetArgErrIf( pQuantFwdTable == NULL, OMX_Sts_BadArgErr) armRetArgErrIf( armNot8ByteAligned(pQuantFwdTable), OMX_Sts_BadArgErr) armRetArgErrIf( armNot8ByteAligned(pQuantRawTable), OMX_Sts_BadArgErr) /* Processing */ for (i = 0; i < 8 ; i++) { for (j = 0; j < 8 ; j++) { /* calculate scale multiplier */ coef = (1.0 / pQuantRawTable[i*8+j]); pQuantFwdTable[i*8+j] = (OMX_U16)armSatRoundFloatToU16(coef * (1 << ARM_ICJP_QUANT_Q) ); } } return OMX_Sts_NoErr;}/*End of File*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -