[FFmpeg-devel,v2] avcodec/mips: Fix failed case: hevc-conformance-AMP_A_Samsung_* when enable msa

Submitted by gxw on Dec. 20, 2018, 2:53 a.m.

Details

Message ID 1545274430-14912-1-git-send-email-guxiwei-hf@loongson.cn
State Accepted
Headers show

Commit Message

gxw Dec. 20, 2018, 2:53 a.m.
The AV_INPUT_BUFFER_PADDING_SIZE has been increased to 64, but the value is still 32
in function ff_hevc_sao_edge_filter_8_msa. So, use AV_INPUT_BUFFER_PADDING_SIZE directly.
Fate tests passed.
---
 libavcodec/mips/hevc_lpf_sao_msa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tomas Härdin Dec. 20, 2018, 1:31 p.m.
tor 2018-12-20 klockan 10:53 +0800 skrev gxw:
> The AV_INPUT_BUFFER_PADDING_SIZE has been increased to 64, but the value is still 32
> in function ff_hevc_sao_edge_filter_8_msa. So, use AV_INPUT_BUFFER_PADDING_SIZE directly.
> Fate tests passed.
> ---
>  libavcodec/mips/hevc_lpf_sao_msa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mips/hevc_lpf_sao_msa.c b/libavcodec/mips/hevc_lpf_sao_msa.c
> index 5b5537a..b146bb1 100644
> --- a/libavcodec/mips/hevc_lpf_sao_msa.c
> +++ b/libavcodec/mips/hevc_lpf_sao_msa.c
> @@ -2630,7 +2630,7 @@ void ff_hevc_sao_edge_filter_8_msa(uint8_t *dst, uint8_t *src,
>                                     int16_t *sao_offset_val,
>                                     int eo, int width, int height)
>  {
> -    ptrdiff_t stride_src = (2 * 64 + 32) / sizeof(uint8_t);
> +    ptrdiff_t stride_src = (2 * 64 + AV_INPUT_BUFFER_PADDING_SIZE) / sizeof(uint8_t);

Good catch. A comment where the 2 and 64 come from might be nice. or 8*8*sizeof(int16_t) maybe.

/Tomas
gxw Dec. 21, 2018, 6:28 a.m.
>tor 2018-12-20 klockan 10:53 +0800 skrev gxw:
>> The AV_INPUT_BUFFER_PADDING_SIZE has been increased to 64, but the value is still 32
>> in function ff_hevc_sao_edge_filter_8_msa. So, use AV_INPUT_BUFFER_PADDING_SIZE directly.
>> Fate tests passed.
>> ---
>>  libavcodec/mips/hevc_lpf_sao_msa.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/libavcodec/mips/hevc_lpf_sao_msa.c b/libavcodec/mips/hevc_lpf_sao_msa.c
>> index 5b5537a..b146bb1 100644
>> --- a/libavcodec/mips/hevc_lpf_sao_msa.c
>> +++ b/libavcodec/mips/hevc_lpf_sao_msa.c
>> @@ -2630,7 +2630,7 @@ void ff_hevc_sao_edge_filter_8_msa(uint8_t *dst, uint8_t *src,
>>                                     int16_t *sao_offset_val,
>>                                     int eo, int width, int height)
>>  {
>> -    ptrdiff_t stride_src = (2 * 64 + 32) / sizeof(uint8_t);
>> +    ptrdiff_t stride_src = (2 * 64 + AV_INPUT_BUFFER_PADDING_SIZE) / sizeof(uint8_t);
>
>Good catch. A comment where the 2 and 64 come from might be nice. or 8*8*sizeof(int16_t) maybe.
>
>/Tomas

Thanks for your advice, mybe I can change it to " ptrdiff_t stride_src = (2 *  MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE) / sizeof(uint8_t);" instead of using immediate data. The corresponding c code is like this.

Patch hide | download patch | download mbox

diff --git a/libavcodec/mips/hevc_lpf_sao_msa.c b/libavcodec/mips/hevc_lpf_sao_msa.c
index 5b5537a..b146bb1 100644
--- a/libavcodec/mips/hevc_lpf_sao_msa.c
+++ b/libavcodec/mips/hevc_lpf_sao_msa.c
@@ -2630,7 +2630,7 @@  void ff_hevc_sao_edge_filter_8_msa(uint8_t *dst, uint8_t *src,
                                    int16_t *sao_offset_val,
                                    int eo, int width, int height)
 {
-    ptrdiff_t stride_src = (2 * 64 + 32) / sizeof(uint8_t);
+    ptrdiff_t stride_src = (2 * 64 + AV_INPUT_BUFFER_PADDING_SIZE) / sizeof(uint8_t);
 
     switch (eo) {
     case 0: