[FFmpeg-devel] Trans.: a64multienc.c and drawutils.c optimisations

Michael Niedermayer michaelni at gmx.at
Wed Dec 28 00:21:19 CET 2011


On Tue, Dec 27, 2011 at 10:59:03PM +0100, yann.lepetitcorps at free.fr wrote:
> I think that needed modifications are in this attachment
> 
> How can I automaticaly replace tabs with the good group of spaces with git (or
> gedit) ?
> 
> I think to make tomorrow some modifications into the libavcodec/admpc.c file at
> the adpcm_ima_qt_expand_nibble() func
> (the 3x diff successives test/additions can certainly to be factorised via a
> multiplication of step with an entry on a table indexed by nibble)

also see START/STOP_TIMER
they are very usefull for benchmarking


[...]
> @@ -38,6 +38,46 @@ int ff_fill_rgba_map(uint8_t *rgba_map, enum PixelFormat pix_fmt)
>      return 0;
>  }
>  
> +void ff_memset8(char *dst, char val, int num)
> +{
> +    memset(dst, val, num);
> +}
> +

> +void ff_memset16(int16_t *dst, int16_t *val, int num)

int16_t val instead of int16_t* should be easier to use


[...]
> @@ -55,8 +95,25 @@ int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t
>              dst_color[rgba_map[i]] = rgba_color[i];
>  
>          line[0] = av_malloc(w * pixel_step[0]);
> -        for (i = 0; i < w; i++)
> -            memcpy(line[0] + i * pixel_step[0], dst_color, pixel_step[0]);
> + 
> +        switch(av_get_bits_per_pixel(pix_desc))
> +        {
> +            case 8  : ff_memset8((char *)line[0], dst_color[0], w);

int8_t


> +		      break;
> +
> +            case 16 : ff_memset16((short int *)line[0], (int16_t *)dst_color, w);

int16_t


> +                      break;
> +
> +            case 24 : ff_memset24((char *)line[0], (char *)dst_color, w);
> +	              break;
> +
> +            case 32 : ff_memset32((int *)line[0], (int32_t *)dst_color, w);

int32_t

[...]

Thanks

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111228/3ef48391/attachment.asc>


More information about the ffmpeg-devel mailing list