Commit ffd38d8b authored by Alexis Ballier's avatar Alexis Ballier Committed by Carl Eugen Hoyos

Use RGB5x5LE, RGB5x5BE, BGR5x5LE and BGR5x5BE instead of their native

endian counterparts.

Patch by Alexis Ballier, alexis D ballier gmail

Originally committed as revision 19626 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent d094052c
...@@ -702,10 +702,14 @@ int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width) ...@@ -702,10 +702,14 @@ int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width)
break; break;
case PIX_FMT_GRAY16BE: case PIX_FMT_GRAY16BE:
case PIX_FMT_GRAY16LE: case PIX_FMT_GRAY16LE:
case PIX_FMT_BGR555: case PIX_FMT_BGR555BE:
case PIX_FMT_BGR565: case PIX_FMT_BGR555LE:
case PIX_FMT_RGB555: case PIX_FMT_BGR565BE:
case PIX_FMT_RGB565: case PIX_FMT_BGR565LE:
case PIX_FMT_RGB555BE:
case PIX_FMT_RGB555LE:
case PIX_FMT_RGB565BE:
case PIX_FMT_RGB565LE:
case PIX_FMT_YUYV422: case PIX_FMT_YUYV422:
picture->linesize[0] = width * 2; picture->linesize[0] = width * 2;
break; break;
...@@ -796,10 +800,14 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, ...@@ -796,10 +800,14 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt,
case PIX_FMT_RGB48LE: case PIX_FMT_RGB48LE:
case PIX_FMT_GRAY16BE: case PIX_FMT_GRAY16BE:
case PIX_FMT_GRAY16LE: case PIX_FMT_GRAY16LE:
case PIX_FMT_BGR555: case PIX_FMT_BGR555BE:
case PIX_FMT_BGR565: case PIX_FMT_BGR555LE:
case PIX_FMT_RGB555: case PIX_FMT_BGR565BE:
case PIX_FMT_RGB565: case PIX_FMT_BGR565LE:
case PIX_FMT_RGB555BE:
case PIX_FMT_RGB555LE:
case PIX_FMT_RGB565BE:
case PIX_FMT_RGB565LE:
case PIX_FMT_YUYV422: case PIX_FMT_YUYV422:
case PIX_FMT_UYVY422: case PIX_FMT_UYVY422:
case PIX_FMT_UYYVYY411: case PIX_FMT_UYYVYY411:
...@@ -860,10 +868,14 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, ...@@ -860,10 +868,14 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
if (pf->pixel_type == FF_PIXEL_PACKED || pf->pixel_type == FF_PIXEL_PALETTE) { if (pf->pixel_type == FF_PIXEL_PACKED || pf->pixel_type == FF_PIXEL_PALETTE) {
if (pix_fmt == PIX_FMT_YUYV422 || if (pix_fmt == PIX_FMT_YUYV422 ||
pix_fmt == PIX_FMT_UYVY422 || pix_fmt == PIX_FMT_UYVY422 ||
pix_fmt == PIX_FMT_BGR565 || pix_fmt == PIX_FMT_BGR565BE ||
pix_fmt == PIX_FMT_BGR555 || pix_fmt == PIX_FMT_BGR565LE ||
pix_fmt == PIX_FMT_RGB565 || pix_fmt == PIX_FMT_BGR555BE ||
pix_fmt == PIX_FMT_RGB555) pix_fmt == PIX_FMT_BGR555LE ||
pix_fmt == PIX_FMT_RGB565BE ||
pix_fmt == PIX_FMT_RGB565LE ||
pix_fmt == PIX_FMT_RGB555BE ||
pix_fmt == PIX_FMT_RGB555LE)
w = width * 2; w = width * 2;
else if (pix_fmt == PIX_FMT_UYYVYY411) else if (pix_fmt == PIX_FMT_UYYVYY411)
w = width + width/2; w = width + width/2;
...@@ -934,7 +946,8 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ ...@@ -934,7 +946,8 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
loss = 0; loss = 0;
pf = &pix_fmt_info[dst_pix_fmt]; pf = &pix_fmt_info[dst_pix_fmt];
if (pf->depth < ps->depth || if (pf->depth < ps->depth ||
(dst_pix_fmt == PIX_FMT_RGB555 && src_pix_fmt == PIX_FMT_RGB565)) ((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE) &&
(src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE)))
loss |= FF_LOSS_DEPTH; loss |= FF_LOSS_DEPTH;
if (pf->x_chroma_shift > ps->x_chroma_shift || if (pf->x_chroma_shift > ps->x_chroma_shift ||
pf->y_chroma_shift > ps->y_chroma_shift) pf->y_chroma_shift > ps->y_chroma_shift)
...@@ -987,10 +1000,14 @@ static int avg_bits_per_pixel(enum PixelFormat pix_fmt) ...@@ -987,10 +1000,14 @@ static int avg_bits_per_pixel(enum PixelFormat pix_fmt)
switch(pix_fmt) { switch(pix_fmt) {
case PIX_FMT_YUYV422: case PIX_FMT_YUYV422:
case PIX_FMT_UYVY422: case PIX_FMT_UYVY422:
case PIX_FMT_RGB565: case PIX_FMT_RGB565BE:
case PIX_FMT_RGB555: case PIX_FMT_RGB565LE:
case PIX_FMT_BGR565: case PIX_FMT_RGB555BE:
case PIX_FMT_BGR555: case PIX_FMT_RGB555LE:
case PIX_FMT_BGR565BE:
case PIX_FMT_BGR565LE:
case PIX_FMT_BGR555BE:
case PIX_FMT_BGR555LE:
bits = 16; bits = 16;
break; break;
case PIX_FMT_UYYVYY411: case PIX_FMT_UYYVYY411:
...@@ -1102,10 +1119,14 @@ int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane) ...@@ -1102,10 +1119,14 @@ int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
switch(pix_fmt) { switch(pix_fmt) {
case PIX_FMT_YUYV422: case PIX_FMT_YUYV422:
case PIX_FMT_UYVY422: case PIX_FMT_UYVY422:
case PIX_FMT_RGB565: case PIX_FMT_RGB565BE:
case PIX_FMT_RGB555: case PIX_FMT_RGB565LE:
case PIX_FMT_BGR565: case PIX_FMT_RGB555BE:
case PIX_FMT_BGR555: case PIX_FMT_RGB555LE:
case PIX_FMT_BGR565BE:
case PIX_FMT_BGR565LE:
case PIX_FMT_BGR555BE:
case PIX_FMT_BGR555LE:
bits = 16; bits = 16;
break; break;
case PIX_FMT_UYYVYY411: case PIX_FMT_UYYVYY411:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment