+1 LGTM -Sirisha
-----Original Message----- From: Libva [mailto:[email protected]] On Behalf Of [email protected] Sent: Thursday, March 05, 2015 3:04 AM To: [email protected] Subject: [Libva] [PATCH 2/3] jpeg_enc: Fix the quatisation matrix scaling. From: Sreerenj Balachandran <[email protected]> The misplaced parentheses are causing wrong value assignment to the quatization matrix. This will allow the ecoding when quality > 50. Otherwise it will simply generate garbage in encoded video for any quality factor greater than 50 --- src/gen8_mfc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gen8_mfc.c b/src/gen8_mfc.c index 698dcae..fbd3a80 100644 --- a/src/gen8_mfc.c +++ b/src/gen8_mfc.c @@ -2721,7 +2721,7 @@ gen8_mfc_jpeg_fqm_state(VADriverContextP ctx, if(qmatrix->load_lum_quantiser_matrix) { //apply quality to lum_quantiser_matrix for(i=0; i < 64; i++) { - temp = qmatrix->lum_quantiser_matrix[i] * (quality/100); + temp = (qmatrix->lum_quantiser_matrix[i] * quality)/100; //clamp to range [1,255] temp = (temp > 255) ? 255 : temp; temp = (temp < 1) ? 1 : temp; @@ -2752,7 +2752,7 @@ gen8_mfc_jpeg_fqm_state(VADriverContextP ctx, if(qmatrix->load_chroma_quantiser_matrix) { //apply quality to chroma_quantiser_matrix for(i=0; i < 64; i++) { - temp = qmatrix->chroma_quantiser_matrix[i] * (quality/100); + temp = (qmatrix->chroma_quantiser_matrix[i] * quality)/100; //clamp to range [1,255] temp = (temp > 255) ? 255 : temp; temp = (temp < 1) ? 1 : temp; -- 1.9.1 _______________________________________________ Libva mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libva _______________________________________________ Libva mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libva
