Skip to content

Commit

Permalink
Merge commit '218aefce4472dc02ee3f12830a9a894bf7916da9'
Browse files Browse the repository at this point in the history
* commit '218aefce4472dc02ee3f12830a9a894bf7916da9':
  dsputil: Move LOCAL_ALIGNED macros to libavutil

Conflicts:
	libavcodec/dvdec.c
	libavcodec/imc.c
	libavcodec/mpegvideo_motion.c

Merged-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Feb 9, 2013
2 parents 276c9c0 + 218aefc commit 6b2e650
Show file tree
Hide file tree
Showing 24 changed files with 47 additions and 35 deletions.
2 changes: 1 addition & 1 deletion libavcodec/aacps.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

#include <stdint.h>
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "avcodec.h"
#include "get_bits.h"
#include "aacps.h"
#include "aacps_tablegen.h"
#include "aacpsdata.c"
#include "dsputil.h"

#define PS_BASELINE 0 ///< Operate in Baseline PS mode
///< Baseline implies 10 or 20 stereo bands,
Expand Down
1 change: 1 addition & 0 deletions libavcodec/aacsbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "fft.h"
#include "aacps.h"
#include "sbrdsp.h"
#include "libavutil/internal.h"
#include "libavutil/libm.h"
#include "libavutil/avassert.h"

Expand Down
2 changes: 1 addition & 1 deletion libavcodec/ac3enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "put_bits.h"
#include "dsputil.h"
#include "ac3dsp.h"
#include "ac3.h"
#include "fft.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/ac3enc_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <stdint.h>

#include "libavutil/internal.h"

/* prototypes for static functions in ac3enc_fixed.c and ac3enc_float.c */

Expand Down
1 change: 1 addition & 0 deletions libavcodec/bink.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "avcodec.h"
#include "dsputil.h"
#include "binkdata.h"
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/dcadec.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/float_dsp.h"
#include "libavutil/internal.h"
#include "libavutil/intmath.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/samplefmt.h"
#include "avcodec.h"
#include "dsputil.h"
#include "fft.h"
#include "get_bits.h"
#include "put_bits.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/dnxhdenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
//#define DEBUG
#define RC_VARIANCE 1 // use variance or ssd for fast rc

#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "dsputil.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/dsputil.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/

#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "avcodec.h"
#include "copy_block.h"
#include "dsputil.h"
Expand Down
26 changes: 0 additions & 26 deletions libavcodec/dsputil.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,30 +436,4 @@ void ff_dsputil_init_dwt(DSPContext *c);
# define STRIDE_ALIGN 8
#endif

// Some broken preprocessors need a second expansion
// to be forced to tokenize __VA_ARGS__
#define E(x) x

#define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
uint8_t la_##v[sizeof(t s o) + (a)]; \
t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)

#define LOCAL_ALIGNED_D(a, t, v, s, o, ...) \
DECLARE_ALIGNED(a, t, la_##v) s o; \
t (*v) o = la_##v

#define LOCAL_ALIGNED(a, t, v, ...) E(LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,))

#if HAVE_LOCAL_ALIGNED_8
# define LOCAL_ALIGNED_8(t, v, ...) E(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,))
#else
# define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED(8, t, v, __VA_ARGS__)
#endif

#if HAVE_LOCAL_ALIGNED_16
# define LOCAL_ALIGNED_16(t, v, ...) E(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,))
#else
# define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__)
#endif

#endif /* AVCODEC_DSPUTIL_H */
1 change: 1 addition & 0 deletions libavcodec/dv.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
* DV codec.
*/

#include "libavutil/internal.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "dsputil.h"
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/dvdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
*/

#include "libavutil/avassert.h"
#include "libavutil/internal.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "dsputil.h"
#include "internal.h"
#include "get_bits.h"
#include "put_bits.h"
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/h264_loopfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
* @author Michael Niedermayer <[email protected]>
*/

#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "internal.h"
#include "dsputil.h"
#include "avcodec.h"
#include "mpegvideo.h"
#include "h264.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/imc.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
#include "libavutil/internal.h"
#include "libavutil/libm.h"
#include "avcodec.h"
#include "get_bits.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/ituh263dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
//#define DEBUG
#include <limits.h>

#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "dsputil.h"
#include "avcodec.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/mpc7.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/

#include "libavutil/channel_layout.h"
#include "libavutil/internal.h"
#include "libavutil/lfg.h"
#include "avcodec.h"
#include "get_bits.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/mpegvideo_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* The simplest mpeg encoder (well, it was the simplest!).
*/

#include "libavutil/internal.h"
#include "libavutil/intmath.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/mpegvideo_motion.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
*/

#include <string.h>

#include "libavutil/avassert.h"
#include "libavutil/internal.h"
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/ppc/mpegaudiodec_altivec.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#include "dsputil_altivec.h"
#include "libavutil/attributes.h"
#include "libavutil/internal.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/dsputil.h"
#include "libavcodec/mpegaudiodsp.h"

#define MACS(rt, ra, rb) rt+=(ra)*(rb)
Expand Down
1 change: 1 addition & 0 deletions libavcodec/ra288.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
#include "libavutil/internal.h"
#include "avcodec.h"
#include "internal.h"
#define BITSTREAM_READER_LE
Expand Down
1 change: 0 additions & 1 deletion libavcodec/rv34.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "libavutil/internal.h"

#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
#include "golomb.h"
#include "internal.h"
Expand Down
1 change: 0 additions & 1 deletion libavcodec/simple_idct.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "dsputil.h"
#include "mathops.h"
#include "simple_idct.h"

Expand Down
1 change: 1 addition & 0 deletions libavcodec/takdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* @author Paul B Mahol
*/

#include "libavutil/internal.h"
#include "libavutil/samplefmt.h"
#include "tak.h"
#include "avcodec.h"
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/x86/mpegaudiodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/internal.h"
#include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
#include "libavcodec/dsputil.h"
#include "libavcodec/mpegaudiodsp.h"

#define DECL(CPU)\
Expand Down
26 changes: 26 additions & 0 deletions libavutil/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,32 @@
# define INT_BIT (CHAR_BIT * sizeof(int))
#endif

// Some broken preprocessors need a second expansion
// to be forced to tokenize __VA_ARGS__
#define E(x) x

#define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
uint8_t la_##v[sizeof(t s o) + (a)]; \
t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)

#define LOCAL_ALIGNED_D(a, t, v, s, o, ...) \
DECLARE_ALIGNED(a, t, la_##v) s o; \
t (*v) o = la_##v

#define LOCAL_ALIGNED(a, t, v, ...) E(LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,))

#if HAVE_LOCAL_ALIGNED_8
# define LOCAL_ALIGNED_8(t, v, ...) E(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,))
#else
# define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED(8, t, v, __VA_ARGS__)
#endif

#if HAVE_LOCAL_ALIGNED_16
# define LOCAL_ALIGNED_16(t, v, ...) E(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,))
#else
# define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__)
#endif

#define FF_ALLOC_OR_GOTO(ctx, p, size, label)\
{\
p = av_malloc(size);\
Expand Down

0 comments on commit 6b2e650

Please sign in to comment.