summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_rgbtest.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-05-07 22:13:35 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-05-07 22:13:35 +0300
commite1cd86076fc830bf2d475539543cf3dacc287ca7 (patch)
tree3651783063fcca8af4645f61f4196276d6f7f6a9 /libmpcodecs/vf_rgbtest.c
parent4c6e3ac01bb158ddaa5603dc93fc7efb91b367b1 (diff)
parent1292c8adc351b1bf461354cd632b39ec3303a8f2 (diff)
downloadmpv-e1cd86076fc830bf2d475539543cf3dacc287ca7.tar.bz2
mpv-e1cd86076fc830bf2d475539543cf3dacc287ca7.tar.xz
Merge svn changes up to r31141
Diffstat (limited to 'libmpcodecs/vf_rgbtest.c')
-rw-r--r--libmpcodecs/vf_rgbtest.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libmpcodecs/vf_rgbtest.c b/libmpcodecs/vf_rgbtest.c
index b7fc3aa55a..02f2774a05 100644
--- a/libmpcodecs/vf_rgbtest.c
+++ b/libmpcodecs/vf_rgbtest.c
@@ -37,11 +37,13 @@ struct vf_priv_s {
static unsigned int getfmt(unsigned int outfmt){
switch(outfmt){
+ case IMGFMT_RGB12:
case IMGFMT_RGB15:
case IMGFMT_RGB16:
case IMGFMT_RGB24:
case IMGFMT_RGBA:
case IMGFMT_ARGB:
+ case IMGFMT_BGR12:
case IMGFMT_BGR15:
case IMGFMT_BGR16:
case IMGFMT_BGR24:
@@ -54,6 +56,12 @@ static unsigned int getfmt(unsigned int outfmt){
static void put_pixel(uint8_t *buf, int x, int y, int stride, int r, int g, int b, int fmt){
switch(fmt){
+ case IMGFMT_BGR12: ((uint16_t*)(buf + y*stride))[x]=
+ ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4);
+ break;
+ case IMGFMT_RGB12: ((uint16_t*)(buf + y*stride))[x]=
+ ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4);
+ break;
case IMGFMT_BGR15: ((uint16_t*)(buf + y*stride))[x]= ((r>>3)<<10) | ((g>>3)<<5) | (b>>3);
break;
case IMGFMT_RGB15: ((uint16_t*)(buf + y*stride))[x]= ((b>>3)<<10) | ((g>>3)<<5) | (r>>3);