diff options
author | marha <marha@users.sourceforge.net> | 2014-10-01 23:12:13 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-10-01 23:12:13 +0200 |
commit | 88236adfe3eb41b8368b4c9ecf3e09a7199dc474 (patch) | |
tree | 6acb3f7ad3c60c4605551245df9c321b5fb22c3b /mesalib/src/gallium/auxiliary/util/u_video.h | |
parent | e4086b3defb6186a2fb8a5845968c97e613fb493 (diff) | |
parent | 30eb28e89e513ba7c04e8424be0cba326a01882b (diff) | |
download | vcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.tar.gz vcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.tar.bz2 vcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
xorg-server/hw/xwin/InitOutput.c
xorg-server/hw/xwin/win.h
xorg-server/hw/xwin/winclipboard/internal.h
xorg-server/hw/xwin/winclipboard/thread.c
xorg-server/hw/xwin/winclipboard/wndproc.c
xorg-server/hw/xwin/winclipboard/xevents.c
xorg-server/hw/xwin/winclipboardinit.c
xorg-server/hw/xwin/winclipboardwrappers.c
xorg-server/hw/xwin/winglobals.c
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_video.h')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_video.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_video.h b/mesalib/src/gallium/auxiliary/util/u_video.h index d1ca7362b..45b2d6e76 100644 --- a/mesalib/src/gallium/auxiliary/util/u_video.h +++ b/mesalib/src/gallium/auxiliary/util/u_video.h @@ -72,6 +72,80 @@ u_reduce_video_profile(enum pipe_video_profile profile) } } +static INLINE void +u_copy_nv12_to_yv12(void *const *destination_data, + uint32_t const *destination_pitches, + int src_plane, int src_field, + int src_stride, int num_fields, + uint8_t const *src, + int width, int height) +{ + int x, y; + unsigned u_stride = destination_pitches[2] * num_fields; + unsigned v_stride = destination_pitches[1] * num_fields; + uint8_t *u_dst = (uint8_t *)destination_data[2] + destination_pitches[2] * src_field; + uint8_t *v_dst = (uint8_t *)destination_data[1] + destination_pitches[1] * src_field; + + /* TODO: SIMD */ + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + u_dst[x] = src[2*x]; + v_dst[x] = src[2*x+1]; + } + u_dst += u_stride; + v_dst += v_stride; + src += src_stride; + } +} + +static INLINE void +u_copy_yv12_to_nv12(void *const *destination_data, + uint32_t const *destination_pitches, + int src_plane, int src_field, + int src_stride, int num_fields, + uint8_t const *src, + int width, int height) +{ + int x, y; + unsigned offset = 2 - src_plane; + unsigned stride = destination_pitches[1] * num_fields; + uint8_t *dst = (uint8_t *)destination_data[1] + destination_pitches[1] * src_field; + + /* TODO: SIMD */ + for (y = 0; y < height; y++) { + for (x = 0; x < 2 * width; x += 2) { + dst[x+offset] = src[x>>1]; + } + dst += stride; + src += src_stride; + } +} + +static INLINE void +u_copy_swap422_packed(void *const *destination_data, + uint32_t const *destination_pitches, + int src_plane, int src_field, + int src_stride, int num_fields, + uint8_t const *src, + int width, int height) +{ + int x, y; + unsigned stride = destination_pitches[0] * num_fields; + uint8_t *dst = (uint8_t *)destination_data[0] + destination_pitches[0] * src_field; + + /* TODO: SIMD */ + for (y = 0; y < height; y++) { + for (x = 0; x < 4 * width; x += 4) { + dst[x+0] = src[x+1]; + dst[x+1] = src[x+0]; + dst[x+2] = src[x+3]; + dst[x+3] = src[x+2]; + } + dst += stride; + src += src_stride; + } +} + #ifdef __cplusplus } #endif |