diff options
author | Sreerenj Balachandran <sreerenj.balachandran@intel.com> | 2015-03-05 13:03:45 +0200 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2015-03-09 10:22:52 +0800 |
commit | 4c0fda6179f9eaa5ae5887a26826af260bc5ee72 (patch) | |
tree | cc86f0f0a9b031a33bf311b1f6a9db4baf91bc48 /src/gen8_mfc.c | |
parent | cec62e1f1b1933141bbc190ab095d5ae0955b0b4 (diff) | |
download | libva-intel-driver-4c0fda6179f9eaa5ae5887a26826af260bc5ee72.tar.gz |
jpeg_enc: Fix the column raster conversion of quatization matrix.
Use temp array for the new raster order calculation, otherwise
it simply generate wrong values.
Note: There is opportunity for more optimization, for eg
we can avoid the usage of mulitple for loops here and there.
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Reviewed-by: Sirisha Muppavarapu <sirisha.muppavarapu@intel.com>
Diffstat (limited to 'src/gen8_mfc.c')
-rw-r--r-- | src/gen8_mfc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gen8_mfc.c b/src/gen8_mfc.c index 85cad857..4192f879 100644 --- a/src/gen8_mfc.c +++ b/src/gen8_mfc.c @@ -2678,7 +2678,7 @@ gen8_mfc_jpeg_fqm_state(VADriverContextP ctx, uint32_t temp, i = 0, j = 0, dword_qm[32]; VAEncPictureParameterBufferJPEG *pic_param; VAQMatrixBufferJPEG *qmatrix; - unsigned char raster_qm[64]; + unsigned char raster_qm[64], column_raster_qm[64]; struct gen6_mfc_context *mfc_context = encoder_context->mfc_context; assert(encode_state->pic_param_ext && encode_state->pic_param_ext->buffer); @@ -2738,11 +2738,11 @@ gen8_mfc_jpeg_fqm_state(VADriverContextP ctx, //Need to double check if our HW expects col or row raster. for (j = 0; j < 64; j++) { int row = j / 8, col = j % 8; - raster_qm[col * 8 + row] = raster_qm[j]; + column_raster_qm[col * 8 + row] = raster_qm[j]; } //Convert to raster QM to reciprocal. HW expects values in reciprocal. - get_reciprocal_dword_qm(raster_qm, dword_qm); + get_reciprocal_dword_qm(column_raster_qm, dword_qm); //send the luma qm to the command buffer gen8_mfc_fqm_state(ctx, MFX_QM_JPEG_LUMA_Y_QUANTIZER_MATRIX, dword_qm, 32, encoder_context); @@ -2769,12 +2769,12 @@ gen8_mfc_jpeg_fqm_state(VADriverContextP ctx, //Need to double check if our HW expects col or row raster. for (j = 0; j < 64; j++) { int row = j / 8, col = j % 8; - raster_qm[col * 8 + row] = raster_qm[j]; + column_raster_qm[col * 8 + row] = raster_qm[j]; } //Convert to raster QM to reciprocal. HW expects values in reciprocal. - get_reciprocal_dword_qm(raster_qm, dword_qm); + get_reciprocal_dword_qm(column_raster_qm, dword_qm); //send the same chroma qm to the command buffer (for both U,V or G,B) gen8_mfc_fqm_state(ctx, MFX_QM_JPEG_CHROMA_CB_QUANTIZER_MATRIX, dword_qm, 32, encoder_context); |