📄 quantize_float.h
字号:
/* libfame - Fast Assembly MPEG Encoder Library Copyright (C) 2000-2001 Vivien Chappelier This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*//********************** floating point quantisation **************************//* quantize *//* *//* Description: *//* Postmultiply and quantize a block *//* *//* Arguments: *//* short *block: the resulting 8x8 block of integer *//* dct_t *cache: a 8x8 block to quantize *//* dct_t *qmatrix: 8x8 coefficients including postscale and quantisation *//* dct_t *round: 8x8 matrix for correct rounding *//* *//* Return value: *//* None. */static void inline quantize(short *block, dct_t *cache, dct_t *qmatrix, dct_t *round){ int i; /* TODO: adjust quantization to avoid overflow at high quality */#define sign0round(a, b) (((a)<0) ? -(b) : (((a)>0) ? (b) : 0) ) for(i = 0; i < 64; i++) block[i] = (short) ((cache[i]+sign0round(cache[i], round[i]))*qmatrix[i]);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -