summaryrefslogtreecommitdiff
path: root/libavcodec/dsputil_template.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-07-21 02:31:57 +0100
committerMans Rullgard <mans@mansr.com>2011-07-21 18:10:58 +0100
commit874f1a901d9f2d1d6825be309ed046abc7672b03 (patch)
tree7638258077e3888e35e86ed7f8242ae2e9cc77a4 /libavcodec/dsputil_template.c
parent5cc2600964c72dad995efb18c918a63e0965f8db (diff)
dsputil: template get_pixels() for different bit depths
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/dsputil_template.c')
-rw-r--r--libavcodec/dsputil_template.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c
index 5863275c00..72ed6bfd2a 100644
--- a/libavcodec/dsputil_template.c
+++ b/libavcodec/dsputil_template.c
@@ -193,6 +193,29 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, int linesize, i
}
#define DCTELEM_FUNCS(dctcoef, suffix) \
+static void FUNCC(get_pixels ## suffix)(DCTELEM *restrict _block, \
+ const uint8_t *_pixels, \
+ int line_size) \
+{ \
+ const pixel *pixels = (const pixel *) _pixels; \
+ dctcoef *restrict block = (dctcoef *) _block; \
+ int i; \
+ \
+ /* read the pixels */ \
+ for(i=0;i<8;i++) { \
+ block[0] = pixels[0]; \
+ block[1] = pixels[1]; \
+ block[2] = pixels[2]; \
+ block[3] = pixels[3]; \
+ block[4] = pixels[4]; \
+ block[5] = pixels[5]; \
+ block[6] = pixels[6]; \
+ block[7] = pixels[7]; \
+ pixels += line_size / sizeof(pixel); \
+ block += 8; \
+ } \
+} \
+ \
static void FUNCC(add_pixels8 ## suffix)(uint8_t *restrict _pixels, \
DCTELEM *_block, \
int line_size) \