[FFmpeg-cvslog] r14336 - in trunk/libavcodec: h264.c h264.h
michael
subversion
Tue Jul 22 15:01:10 CEST 2008
Author: michael
Date: Tue Jul 22 15:01:10 2008
New Revision: 14336
Log:
qscale has a range of 0..51 we thus do not need a 256 entry table and neither need
to and it with 0xFF.
Modified:
trunk/libavcodec/h264.c
trunk/libavcodec/h264.h
Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c (original)
+++ trunk/libavcodec/h264.c Tue Jul 22 15:01:10 2008
@@ -1584,7 +1584,7 @@ static void chroma_dc_dct_c(DCTELEM *blo
* gets the chroma qp.
*/
static inline int get_chroma_qp(H264Context *h, int t, int qscale){
- return h->pps.chroma_qp_table[t][qscale & 0xff];
+ return h->pps.chroma_qp_table[t][qscale];
}
//FIXME need to check that this does not overflow signed 32 bit for low qp, I am not sure, it's very close
@@ -7337,8 +7337,8 @@ static void
build_qp_table(PPS *pps, int t, int index)
{
int i;
- for(i = 0; i < 255; i++)
- pps->chroma_qp_table[t][i & 0xff] = chroma_qp[av_clip(i + index, 0, 51)];
+ for(i = 0; i < 52; i++)
+ pps->chroma_qp_table[t][i] = chroma_qp[av_clip(i + index, 0, 51)];
}
static inline int decode_picture_parameter_set(H264Context *h, int bit_length){
Modified: trunk/libavcodec/h264.h
==============================================================================
--- trunk/libavcodec/h264.h (original)
+++ trunk/libavcodec/h264.h Tue Jul 22 15:01:10 2008
@@ -138,7 +138,7 @@ typedef struct PPS{
int transform_8x8_mode; ///< transform_8x8_mode_flag
uint8_t scaling_matrix4[6][16];
uint8_t scaling_matrix8[2][64];
- uint8_t chroma_qp_table[2][256]; ///< pre-scaled (with chroma_qp_index_offset) version of qp_table
+ uint8_t chroma_qp_table[2][64]; ///< pre-scaled (with chroma_qp_index_offset) version of qp_table
int chroma_qp_diff;
}PPS;
More information about the ffmpeg-cvslog
mailing list