Diego Biurrun <di...@biurrun.de> writes:

> The function is used elsewhere and does not belong with the LZO code.
> ---
> This might or might not need some version bump ifdefs since a public
> function's declaration is moved from one header to another.
>
>  libavcodec/dfa.c      |    3 ++-
>  libavcodec/eatgv.c    |    2 +-
>  libavcodec/g723_1.c   |    2 +-
>  libavcodec/lcldec.c   |    1 +
>  libavcodec/wmavoice.c |    2 +-
>  libavcodec/xan.c      |    3 +--
>  libavcodec/xxan.c     |    3 +--
>  libavutil/lzo.c       |   48 ++----------------------------------------------
>  libavutil/lzo.h       |   11 -----------
>  libavutil/mem.c       |   49 
> +++++++++++++++++++++++++++++++++++++++++++++++++
>  libavutil/mem.h       |   12 ++++++++++++
>  11 files changed, 71 insertions(+), 65 deletions(-)
>
> diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
> index 39f0f64..fb751f6 100644
> --- a/libavcodec/dfa.c
> +++ b/libavcodec/dfa.c
> @@ -24,7 +24,8 @@
>  #include "bytestream.h"
>
>  #include "libavutil/imgutils.h"
> -#include "libavutil/lzo.h" // for av_memcpy_backptr
> +#include "libavutil/lzo.h"
> +#include "libavutil/mem.h"

memcpy and friends are declared in string.h, so perhaps we should follow
the same convention.

> +// Define if we may write up to 12 bytes beyond the output buffer.
> +#define OUTBUF_PADDED 1

WTF?!

> +//#define UNALIGNED_LOADSTORE
> +#define BUILTIN_MEMCPY

WTF is that supposed to mean?

> +#ifdef UNALIGNED_LOADSTORE
> +#define COPY2(d, s) *(uint16_t *)(d) = *(uint16_t *)(s);
> +#elif defined(BUILTIN_MEMCPY)
> +#define COPY2(d, s) memcpy(d, s, 2);
> +#else
> +#define COPY2(d, s) (d)[0] = (s)[0]; (d)[1] = (s)[1];
> +#endif

Just use intreadwrite.h and be done with it.

I know you're merely moving code, but sometimes things are simply too
filthy to be left alone.

-- 
Måns Rullgård
m...@mansr.com
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to