[FFmpeg-devel] [PATCH 2/3] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for HEVC loop filter and sao functions

Michael Niedermayer michaelni at gmx.at
Thu Jun 4 19:09:19 CEST 2015


On Thu, Jun 04, 2015 at 01:31:48PM +0530, shivraj.patil at imgtec.com wrote:
> From: Shivraj Patil <shivraj.patil at imgtec.com>
> 
> This patch adds MSA (MIPS-SIMD-Arch) optimizations for HEVC loop filter and sao functions in new file hevc_lpf_sao_msa.c
> Adds new generic macros (needed for this patch) in libavutil/mips/generic_macros_msa.h
[...]
> +static void sao_band_filter_0_8_c(uint8_t *dst, uint8_t *src,
> +                                  ptrdiff_t stride_dst, ptrdiff_t stride_src,
> +                                  int16_t *sao_offset_val, int sao_left_class,
> +                                  int width, int height)
> +{
> +    int offset_table[32] = { 0 };
> +    int k, y, x;
> +    int shift = 8 - 5;
> +
> +    stride_dst /= sizeof(uint8_t);
> +    stride_src /= sizeof(uint8_t);
> +
> +    for (k = 0; k < 4; k++)
> +        offset_table[(k + sao_left_class) & 31] = sao_offset_val[k + 1];
> +    for (y = 0; y < height; y++) {

> +        for (x = 0; x < width; x++)
> +            dst[x] = av_clip_uint8_c(src[x] + offset_table[src[x] >> shift]);

why does this use av_clip_uint8_c() instead of av_clip_uint8() ?

also thats not the only occurance of av_clip_uint8_c()

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150604/5c673238/attachment.asc>


More information about the ffmpeg-devel mailing list