summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/decode/lavc.h1
-rw-r--r--video/decode/vd_lavc.c19
-rw-r--r--video/filter/vf_crop.c8
-rw-r--r--video/filter/vf_delogo.c10
-rw-r--r--video/filter/vf_divtc.c7
-rw-r--r--video/filter/vf_down3dright.c8
-rw-r--r--video/filter/vf_eq.c9
-rw-r--r--video/filter/vf_expand.c2
-rw-r--r--video/filter/vf_format.c2
-rw-r--r--video/filter/vf_gradfun.c13
-rw-r--r--video/filter/vf_hqdn3d.c13
-rw-r--r--video/filter/vf_ilpack.c8
-rw-r--r--video/filter/vf_mirror.c3
-rw-r--r--video/filter/vf_noformat.c2
-rw-r--r--video/filter/vf_noise.c10
-rw-r--r--video/filter/vf_pp.c10
-rw-r--r--video/filter/vf_pullup.c4
-rw-r--r--video/filter/vf_rotate.c10
-rw-r--r--video/filter/vf_scale.c39
-rw-r--r--video/filter/vf_sub.c12
-rw-r--r--video/filter/vf_swapuv.c11
-rw-r--r--video/filter/vf_unsharp.c10
-rw-r--r--video/filter/vf_yadif.c5
-rw-r--r--video/fmt-conversion.c58
-rw-r--r--video/image_writer.c8
-rw-r--r--video/img_format.c217
-rw-r--r--video/img_format.h422
-rw-r--r--video/img_fourcc.h57
-rw-r--r--video/out/gl_common.c10
-rw-r--r--video/out/vo.h2
-rw-r--r--video/out/vo_corevideo.m4
-rw-r--r--video/out/vo_direct3d.c12
-rw-r--r--video/out/vo_opengl.c2
-rw-r--r--video/out/vo_opengl_old.c4
-rw-r--r--video/out/vo_sdl.c12
-rw-r--r--video/out/vo_vdpau.c12
-rw-r--r--video/out/vo_x11.c4
-rw-r--r--video/out/vo_xv.c36
38 files changed, 500 insertions, 576 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h
index a355f61310..df3f97ef87 100644
--- a/video/decode/lavc.h
+++ b/video/decode/lavc.h
@@ -21,7 +21,6 @@ typedef struct ffmpeg_ctx {
double inv_qp_sum;
AVRational last_sample_aspect_ratio;
enum AVDiscard skip_frame;
- int rawvideo_fmt;
AVCodec *software_fallback;
struct FramePool *dr1_buffer_pool;
struct mp_image_pool *non_dr1_pool;
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 24c3ba4e36..bf4cd42ba3 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -244,7 +244,6 @@ static int init(sh_video_t *sh)
AVCodec *lavc_codec = NULL;
ctx = sh->context = talloc_zero(NULL, vd_ffmpeg_ctx);
- ctx->rawvideo_fmt = PIX_FMT_NONE;
ctx->non_dr1_pool = talloc_steal(ctx, mp_image_pool_new(16));
if (sh->codec->dll) {
@@ -264,10 +263,6 @@ static int init(sh_video_t *sh)
uninit(sh);
return 0;
}
- } else if (!IMGFMT_IS_HWACCEL(sh->format)) {
- ctx->rawvideo_fmt = imgfmt2pixfmt(sh->format);
- if (ctx->rawvideo_fmt != PIX_FMT_NONE)
- lavc_codec = avcodec_find_decoder_by_name("rawvideo");
}
if (!lavc_codec) {
uninit(sh);
@@ -358,11 +353,7 @@ static int init_avctx(sh_video_t *sh, AVCodec *lavc_codec, struct hwdec *hwdec)
if (lavc_param->gray)
avctx->flags |= CODEC_FLAG_GRAY;
avctx->flags2 |= lavc_param->fast;
- if (ctx->rawvideo_fmt == PIX_FMT_NONE) {
- avctx->codec_tag = sh->format;
- } else {
- avctx->pix_fmt = ctx->rawvideo_fmt;
- }
+ avctx->codec_tag = sh->format;
if (sh->gsh->lavf_codec_tag)
avctx->codec_tag = sh->gsh->lavf_codec_tag;
avctx->stream_codec_tag = sh->video.fccHandler;
@@ -440,6 +431,14 @@ static int init_avctx(sh_video_t *sh, AVCodec *lavc_codec, struct hwdec *hwdec)
}
break;
+ case MKTAG('M', 'P', 'v', 'f'):
+ avctx->codec_tag = 0;
+ avctx->pix_fmt = imgfmt2pixfmt(sh->imgfmt);
+ break;
+ case MKTAG('M', 'P', 'r', 'v'):
+ avctx->codec_tag = sh->imgfmt;
+ break;
+
default:
if (!sh->bih || sh->bih->biSize <= sizeof(*sh->bih))
break;
diff --git a/video/filter/vf_crop.c b/video/filter/vf_crop.c
index 692d05bcc9..c1cb069a81 100644
--- a/video/filter/vf_crop.c
+++ b/video/filter/vf_crop.c
@@ -54,18 +54,14 @@ static int config(struct vf_instance *vf,
if(!IMGFMT_IS_RGB(outfmt) && !IMGFMT_IS_BGR(outfmt)){
switch(outfmt){
case IMGFMT_444P:
- case IMGFMT_Y800:
case IMGFMT_Y8:
break;
- case IMGFMT_YVU9:
- case IMGFMT_IF09:
+ case IMGFMT_410P:
vf->priv->crop_y&=~3;
case IMGFMT_411P:
vf->priv->crop_x&=~3;
break;
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
+ case IMGFMT_420P:
vf->priv->crop_y&=~1;
default:
vf->priv->crop_x&=~1;
diff --git a/video/filter/vf_delogo.c b/video/filter/vf_delogo.c
index f709aad4d0..346eb468f5 100644
--- a/video/filter/vf_delogo.c
+++ b/video/filter/vf_delogo.c
@@ -207,18 +207,14 @@ static void uninit(struct vf_instance *vf){
static int query_format(struct vf_instance *vf, unsigned int fmt){
switch(fmt)
{
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
+ case IMGFMT_420P:
return vf_next_query_format(vf,vf->priv->outfmt);
}
return 0;
}
static const unsigned int fmt_list[]={
- IMGFMT_YV12,
- IMGFMT_I420,
- IMGFMT_IYUV,
+ IMGFMT_420P,
0
};
@@ -306,7 +302,7 @@ static int vf_open(vf_instance_t *vf, char *args){
fix_band(vf->priv);
// check csp:
- vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);
+ vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_420P);
if(!vf->priv->outfmt)
{
uninit(vf);
diff --git a/video/filter/vf_divtc.c b/video/filter/vf_divtc.c
index dadccf9a9b..19b23ac481 100644
--- a/video/filter/vf_divtc.c
+++ b/video/filter/vf_divtc.c
@@ -577,11 +577,10 @@ static int query_format(struct vf_instance *vf, unsigned int fmt)
{
switch(fmt)
{
- case IMGFMT_444P: case IMGFMT_IYUV: case IMGFMT_RGB24:
+ case IMGFMT_444P: case IMGFMT_RGB24:
case IMGFMT_422P: case IMGFMT_UYVY: case IMGFMT_BGR24:
- case IMGFMT_411P: case IMGFMT_YUY2: case IMGFMT_IF09:
- case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_YVU9:
- case IMGFMT_IUYV: case IMGFMT_Y800: case IMGFMT_Y8:
+ case IMGFMT_411P: case IMGFMT_YUYV: case IMGFMT_410P:
+ case IMGFMT_420P: case IMGFMT_Y8:
return vf_next_query_format(vf,fmt);
}
diff --git a/video/filter/vf_down3dright.c b/video/filter/vf_down3dright.c
index b1835cd26b..21616a4ad2 100644
--- a/video/filter/vf_down3dright.c
+++ b/video/filter/vf_down3dright.c
@@ -114,7 +114,7 @@ static int config(struct vf_instance *vf,
{
/* FIXME - also support UYVY output? */
return vf_next_config(vf, width * vf->priv->scalew,
- height / vf->priv->scaleh - vf->priv->skipline, d_width, d_height, flags, IMGFMT_YV12);
+ height / vf->priv->scaleh - vf->priv->skipline, d_width, d_height, flags, IMGFMT_420P);
}
@@ -122,10 +122,8 @@ static int query_format(struct vf_instance *vf, unsigned int fmt)
{
/* FIXME - really any YUV 4:2:0 input format should work */
switch (fmt) {
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- return vf_next_query_format(vf, IMGFMT_YV12);
+ case IMGFMT_420P:
+ return vf_next_query_format(vf, IMGFMT_420P);
}
return 0;
}
diff --git a/video/filter/vf_eq.c b/video/filter/vf_eq.c
index cfbe7ea17e..76a8b2bc99 100644
--- a/video/filter/vf_eq.c
+++ b/video/filter/vf_eq.c
@@ -425,16 +425,13 @@ static
int query_format (vf_instance_t *vf, unsigned fmt)
{
switch (fmt) {
- case IMGFMT_YVU9:
- case IMGFMT_IF09:
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_Y800:
case IMGFMT_Y8:
case IMGFMT_444P:
case IMGFMT_422P:
+ case IMGFMT_440P:
+ case IMGFMT_420P:
case IMGFMT_411P:
+ case IMGFMT_410P:
return vf_next_query_format (vf, fmt);
}
diff --git a/video/filter/vf_expand.c b/video/filter/vf_expand.c
index 5ce5db16bd..f8ebbd0b18 100644
--- a/video/filter/vf_expand.c
+++ b/video/filter/vf_expand.c
@@ -66,7 +66,7 @@ static int config(struct vf_instance *vf,
struct MPOpts *opts = vf->opts;
mp_image_t test_mpi;
mp_image_setfmt(&test_mpi, outfmt);
- if (outfmt == IMGFMT_IF09 || !test_mpi.bpp) return 0;
+ if (test_mpi.num_planes > 3 || !test_mpi.bpp) return 0;
vf->priv->exp_x = vf->priv->cfg_exp_x;
vf->priv->exp_y = vf->priv->cfg_exp_y;
vf->priv->exp_w = vf->priv->cfg_exp_w;
diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c
index 8abbd9b054..71e3ad7669 100644
--- a/video/filter/vf_format.c
+++ b/video/filter/vf_format.c
@@ -35,7 +35,7 @@ static struct vf_priv_s {
unsigned int fmt;
unsigned int outfmt;
} const vf_priv_dflt = {
- IMGFMT_YUY2,
+ IMGFMT_YUYV,
0
};
diff --git a/video/filter/vf_gradfun.c b/video/filter/vf_gradfun.c
index b9d07bc907..b3c0702375 100644
--- a/video/filter/vf_gradfun.c
+++ b/video/filter/vf_gradfun.c
@@ -321,20 +321,15 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
static int query_format(struct vf_instance *vf, unsigned int fmt)
{
switch (fmt){
- case IMGFMT_YVU9:
- case IMGFMT_IF09:
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_CLPL:
- case IMGFMT_Y800:
- case IMGFMT_Y8:
case IMGFMT_NV12:
case IMGFMT_NV21:
+ case IMGFMT_Y8:
case IMGFMT_444P:
case IMGFMT_422P:
+ case IMGFMT_440P:
+ case IMGFMT_420P:
case IMGFMT_411P:
- case IMGFMT_HM12:
+ case IMGFMT_410P:
return vf_next_query_format(vf,fmt);
}
return 0;
diff --git a/video/filter/vf_hqdn3d.c b/video/filter/vf_hqdn3d.c
index 1ec0cc5c66..4f49f12715 100644
--- a/video/filter/vf_hqdn3d.c
+++ b/video/filter/vf_hqdn3d.c
@@ -245,13 +245,12 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
static int query_format(struct vf_instance *vf, unsigned int fmt){
switch(fmt)
{
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_YVU9:
- case IMGFMT_444P:
- case IMGFMT_422P:
- case IMGFMT_411P:
+ case IMGFMT_444P:
+ case IMGFMT_422P:
+ case IMGFMT_440P:
+ case IMGFMT_420P:
+ case IMGFMT_411P:
+ case IMGFMT_410P:
return vf_next_query_format(vf, fmt);
}
return 0;
diff --git a/video/filter/vf_ilpack.c b/video/filter/vf_ilpack.c
index 73f816cb9e..f153a4b7d0 100644
--- a/video/filter/vf_ilpack.c
+++ b/video/filter/vf_ilpack.c
@@ -389,7 +389,7 @@ static int config(struct vf_instance *vf,
unsigned int flags, unsigned int outfmt)
{
/* FIXME - also support UYVY output? */
- return vf_next_config(vf, width, height, d_width, d_height, flags, IMGFMT_YUY2);
+ return vf_next_config(vf, width, height, d_width, d_height, flags, IMGFMT_YUYV);
}
@@ -397,10 +397,8 @@ static int query_format(struct vf_instance *vf, unsigned int fmt)
{
/* FIXME - really any YUV 4:2:0 input format should work */
switch (fmt) {
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- return vf_next_query_format(vf,IMGFMT_YUY2);
+ case IMGFMT_420P:
+ return vf_next_query_format(vf,IMGFMT_YUYV);
}
return 0;
}
diff --git a/video/filter/vf_mirror.c b/video/filter/vf_mirror.c
index b826ee46f7..56fc2ebb3d 100644
--- a/video/filter/vf_mirror.c
+++ b/video/filter/vf_mirror.c
@@ -50,8 +50,7 @@ static void mirror(unsigned char* dst,unsigned char* src,int dststride,int srcst
dst[x*4+3]=src[1+(w2-x-1)*4];
}
break; }
- case IMGFMT_YUY2:
- case IMGFMT_YVYU: {
+ case IMGFMT_YUYV: {
// packed YUV is tricky. U,V are 32bpp while Y is 16bpp:
int w2=w>>1;
for(x=0;x<w2;x++){
diff --git a/video/filter/vf_noformat.c b/video/filter/vf_noformat.c
index 6964a2955c..3d7e841db6 100644
--- a/video/filter/vf_noformat.c
+++ b/video/filter/vf_noformat.c
@@ -34,7 +34,7 @@
static struct vf_priv_s {
unsigned int fmt;
} const vf_priv_dflt = {
- IMGFMT_YV12
+ IMGFMT_420P
};
//===========================================================================//
diff --git a/video/filter/vf_noise.c b/video/filter/vf_noise.c
index 44f96765b4..0af7da5c9a 100644
--- a/video/filter/vf_noise.c
+++ b/video/filter/vf_noise.c
@@ -358,9 +358,7 @@ static void uninit(struct vf_instance *vf){
static int query_format(struct vf_instance *vf, unsigned int fmt){
switch(fmt)
{
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
+ case IMGFMT_420P:
return vf_next_query_format(vf,vf->priv->outfmt);
}
return 0;
@@ -391,9 +389,7 @@ static void parse(FilterParam *fp, char* args){
}
static const unsigned int fmt_list[]={
- IMGFMT_YV12,
- IMGFMT_I420,
- IMGFMT_IYUV,
+ IMGFMT_420P,
0
};
@@ -412,7 +408,7 @@ static int vf_open(vf_instance_t *vf, char *args){
}
// check csp:
- vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);
+ vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_420P);
if(!vf->priv->outfmt)
{
uninit(vf);
diff --git a/video/filter/vf_pp.c b/video/filter/vf_pp.c
index 8a6b1cf172..157dc3e068 100644
--- a/video/filter/vf_pp.c
+++ b/video/filter/vf_pp.c
@@ -72,11 +72,9 @@ static void uninit(struct vf_instance *vf){
static int query_format(struct vf_instance *vf, unsigned int fmt){
switch(fmt){
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
case IMGFMT_444P:
case IMGFMT_422P:
+ case IMGFMT_420P:
case IMGFMT_411P:
return vf_next_query_format(vf,fmt);
}
@@ -133,9 +131,7 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
extern int divx_quality;
static const unsigned int fmt_list[]={
- IMGFMT_YV12,
- IMGFMT_I420,
- IMGFMT_IYUV,
+ IMGFMT_420P,
IMGFMT_444P,
IMGFMT_422P,
IMGFMT_411P,
@@ -155,7 +151,7 @@ static int vf_open(vf_instance_t *vf, char *args){
vf->priv->context=NULL;
// check csp:
- vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);
+ vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_420P);
if(!vf->priv->outfmt) return 0; // no csp match :(
char *name = args ? args : "de";
diff --git a/video/filter/vf_pullup.c b/video/filter/vf_pullup.c
index 45e80b6b57..0a6e4c6b25 100644
--- a/video/filter/vf_pullup.c
+++ b/video/filter/vf_pullup.c
@@ -224,9 +224,7 @@ static int query_format(struct vf_instance *vf, unsigned int fmt)
{
/* FIXME - support more formats */
switch (fmt) {
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
+ case IMGFMT_420P:
return vf_next_query_format(vf, fmt);
}
return 0;
diff --git a/video/filter/vf_rotate.c b/video/filter/vf_rotate.c
index f44c874c1f..d6d2d0df85 100644
--- a/video/filter/vf_rotate.c
+++ b/video/filter/vf_rotate.c
@@ -111,14 +111,10 @@ static int query_format(struct vf_instance *vf, unsigned int fmt){
if(IMGFMT_IS_RGB(fmt) || IMGFMT_IS_BGR(fmt)) return vf_next_query_format(vf, fmt);
// we can support only symmetric (chroma_x_shift==chroma_y_shift) YUV formats:
switch(fmt) {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_YVU9:
-// case IMGFMT_IF09:
case IMGFMT_Y8:
- case IMGFMT_Y800:
- case IMGFMT_444P:
+ case IMGFMT_444P:
+ case IMGFMT_420P:
+ case IMGFMT_410P:
return vf_next_query_format(vf, fmt);
}
return 0;
diff --git a/video/filter/vf_scale.c b/video/filter/vf_scale.c
index a10825ee56..ca06436dd5 100644
--- a/video/filter/vf_scale.c
+++ b/video/filter/vf_scale.c
@@ -87,8 +87,7 @@ static const unsigned int outfmt_list[]={
IMGFMT_422P10_BE,
IMGFMT_422P9_LE,
IMGFMT_422P9_BE,
- IMGFMT_YV12,
- IMGFMT_I420,
+ IMGFMT_420P,
IMGFMT_420P16_LE,
IMGFMT_420P16_BE,
IMGFMT_420P14_LE,
@@ -99,14 +98,12 @@ static const unsigned int outfmt_list[]={
IMGFMT_420P10_BE,
IMGFMT_420P9_LE,
IMGFMT_420P9_BE,
- IMGFMT_420A,
- IMGFMT_IYUV,
- IMGFMT_YVU9,
- IMGFMT_IF09,
+ IMGFMT_420AP,
+ IMGFMT_410P,
IMGFMT_411P,
IMGFMT_NV12,
IMGFMT_NV21,
- IMGFMT_YUY2,
+ IMGFMT_YUYV,
IMGFMT_UYVY,
IMGFMT_440P,
// RGB and grayscale (Y8 and Y800):
@@ -119,24 +116,22 @@ static const unsigned int outfmt_list[]={
IMGFMT_BGR24,
IMGFMT_RGB24,
IMGFMT_GBRP,
- IMGFMT_RGB48LE,
- IMGFMT_RGB48BE,
+ IMGFMT_RGB48_LE,
+ IMGFMT_RGB48_BE,
IMGFMT_BGR16,
IMGFMT_RGB16,
IMGFMT_BGR15,
IMGFMT_RGB15,
IMGFMT_BGR12,
IMGFMT_RGB12,
- IMGFMT_Y800,
IMGFMT_Y8,
IMGFMT_BGR8,
IMGFMT_RGB8,
IMGFMT_BGR4,
IMGFMT_RGB4,
- IMGFMT_BG4B,
- IMGFMT_RG4B,
- IMGFMT_BGR1,
- IMGFMT_RGB1,
+ IMGFMT_RGB4_BYTE,
+ IMGFMT_BGR4_BYTE,
+ IMGFMT_MONO,
0
};
@@ -147,13 +142,13 @@ static const unsigned int outfmt_list[]={
* fast assembler implementation.
*/
static int preferred_conversions[][2] = {
- {IMGFMT_YUY2, IMGFMT_UYVY},
- {IMGFMT_YUY2, IMGFMT_422P},
- {IMGFMT_UYVY, IMGFMT_YUY2},
+ {IMGFMT_YUYV, IMGFMT_UYVY},
+ {IMGFMT_YUYV, IMGFMT_422P},
+ {IMGFMT_UYVY, IMGFMT_YUYV},
{IMGFMT_UYVY, IMGFMT_422P},
- {IMGFMT_422P, IMGFMT_YUY2},
+ {IMGFMT_422P, IMGFMT_YUYV},
{IMGFMT_422P, IMGFMT_UYVY},
- {IMGFMT_420P10, IMGFMT_YV12},
+ {IMGFMT_420P10, IMGFMT_420P},
{IMGFMT_GBRP, IMGFMT_BGR24},
{IMGFMT_GBRP, IMGFMT_RGB24},
{IMGFMT_GBRP, IMGFMT_BGR32},
@@ -277,13 +272,11 @@ static int config(struct vf_instance *vf,
// calculate the missing parameters:
switch(best) {
- case IMGFMT_YV12: /* YV12 needs w & h rounded to 2 */
- case IMGFMT_I420:
- case IMGFMT_IYUV:
+ case IMGFMT_420P: /* YV12 needs w & h rounded to 2 */
case IMGFMT_NV12:
case IMGFMT_NV21:
vf->priv->h = (vf->priv->h + 1) & ~1;
- case IMGFMT_YUY2: /* YUY2 needs w rounded to 2 */
+ case IMGFMT_YUYV: /* YUY2 needs w rounded to 2 */
case IMGFMT_UYVY:
vf->priv->w = (vf->priv->w + 1) & ~1;
}
diff --git a/video/filter/vf_sub.c b/video/filter/vf_sub.c
index 96100801ff..8cda9f5e79 100644
--- a/video/filter/vf_sub.c
+++ b/video/filter/vf_sub.c
@@ -61,8 +61,6 @@ static int config(struct vf_instance *vf,
unsigned int flags, unsigned int outfmt)
{
struct MPOpts *opts = vf->opts;
- if (outfmt == IMGFMT_IF09)
- return 0;
vf->priv->outh = height + vf->priv->opt_top_margin +
vf->priv->opt_bottom_margin;
@@ -178,9 +176,7 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
static int query_format(struct vf_instance *vf, unsigned int fmt)
{
switch (fmt) {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
+ case IMGFMT_420P:
return vf_next_query_format(vf, vf->priv->outfmt);
}
return 0;
@@ -209,15 +205,13 @@ static void uninit(struct vf_instance *vf)
}
static const unsigned int fmt_list[] = {
- IMGFMT_YV12,
- IMGFMT_I420,
- IMGFMT_IYUV,
+ IMGFMT_420P,
0
};
static int vf_open(vf_instance_t *vf, char *args)
{
- vf->priv->outfmt = vf_match_csp(&vf->next, fmt_list, IMGFMT_YV12);
+ vf->priv->outfmt = vf_match_csp(&vf->next, fmt_list, IMGFMT_420P);
if (!vf->priv->outfmt) {
uninit(vf);
return 0;
diff --git a/video/filter/vf_swapuv.c b/video/filter/vf_swapuv.c
index 5e879ff557..a9083ccaa8 100644
--- a/video/filter/vf_swapuv.c
+++ b/video/filter/vf_swapuv.c
@@ -42,13 +42,12 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
static int query_format(struct vf_instance *vf, unsigned int fmt){
switch(fmt)
{
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_YVU9:
case IMGFMT_444P:
- case IMGFMT_422P:
- case IMGFMT_411P:
+ case IMGFMT_422P:
+ case IMGFMT_440P:
+ case IMGFMT_420P:
+ case IMGFMT_411P:
+ case IMGFMT_410P:
return vf_next_query_format(vf, fmt);
}
return 0;
diff --git a/video/filter/vf_unsharp.c b/video/filter/vf_unsharp.c
index c3150b9a33..dcca82df5b 100644
--- a/video/filter/vf_unsharp.c
+++ b/video/filter/vf_unsharp.c
@@ -206,9 +206,7 @@ static void uninit( struct vf_instance *vf ) {
static int query_format( struct vf_instance *vf, unsigned int fmt ) {
switch(fmt) {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
+ case IMGFMT_420P:
return vf_next_query_format( vf, vf->priv->outfmt );
}
return 0;
@@ -241,9 +239,7 @@ static void parse( FilterParam *fp, char* args ) {
//===========================================================================//
static const unsigned int fmt_list[] = {
- IMGFMT_YV12,
- IMGFMT_I420,
- IMGFMT_IYUV,
+ IMGFMT_420P,
0
};
@@ -279,7 +275,7 @@ static int vf_open( vf_instance_t *vf, char *args ) {
}
// check csp:
- vf->priv->outfmt = vf_match_csp( &vf->next, fmt_list, IMGFMT_YV12 );
+ vf->priv->outfmt = vf_match_csp( &vf->next, fmt_list, IMGFMT_420P );
if( !vf->priv->outfmt ) {
uninit( vf );
return 0; // no csp match :(
diff --git a/video/filter/vf_yadif.c b/video/filter/vf_yadif.c
index 4e53ef168c..10ce6d9e8e 100644
--- a/video/filter/vf_yadif.c
+++ b/video/filter/vf_yadif.c
@@ -477,10 +477,7 @@ static void uninit(struct vf_instance *vf){
//===========================================================================//
static int query_format(struct vf_instance *vf, unsigned int fmt){
switch(fmt){
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_Y800:
+ case IMGFMT_420P:
case IMGFMT_Y8:
return vf_next_query_format(vf,fmt);
}
diff --git a/video/fmt-conversion.c b/video/fmt-conversion.c
index 6a45713f7c..cf3aaa7452 100644
--- a/video/fmt-conversion.c
+++ b/video/fmt-conversion.c
@@ -29,52 +29,47 @@ static const struct {
{IMGFMT_ARGB, PIX_FMT_ARGB},
{IMGFMT_BGRA, PIX_FMT_BGRA},
{IMGFMT_BGR24, PIX_FMT_BGR24},
- {IMGFMT_BGR16BE, PIX_FMT_RGB565BE},
- {IMGFMT_BGR16LE, PIX_FMT_RGB565LE},
- {IMGFMT_BGR15BE, PIX_FMT_RGB555BE},
- {IMGFMT_BGR15LE, PIX_FMT_RGB555LE},
- {IMGFMT_BGR12BE, PIX_FMT_RGB444BE},
- {IMGFMT_BGR12LE, PIX_FMT_RGB444LE},
+ {IMGFMT_BGR16_BE, PIX_FMT_RGB565BE},
+ {IMGFMT_BGR16_LE, PIX_FMT_RGB565LE},
+ {IMGFMT_BGR15_BE, PIX_FMT_RGB555BE},
+ {IMGFMT_BGR15_LE, PIX_FMT_RGB555LE},
+ {IMGFMT_BGR12_BE, PIX_FMT_RGB444BE},
+ {IMGFMT_BGR12_LE, PIX_FMT_RGB444LE},
{IMGFMT_BGR8, PIX_FMT_RGB8},
{IMGFMT_BGR4, PIX_FMT_RGB4},
- {IMGFMT_BGR1, PIX_FMT_MONOBLACK},
- {IMGFMT_RGB1, PIX_FMT_MONOBLACK},
- {IMGFMT_RG4B, PIX_FMT_BGR4_BYTE},
- {IMGFMT_BG4B, PIX_FMT_RGB4_BYTE},
- {IMGFMT_RGB48LE, PIX_FMT_RGB48LE},
- {IMGFMT_RGB48BE, PIX_FMT_RGB48BE},
+ {IMGFMT_MONO, PIX_FMT_MONOBLACK},
+ {IMGFMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE},
+ {IMGFMT_BGR4_BYTE, PIX_FMT_RGB4_BYTE},
+ {IMGFMT_RGB48_LE, PIX_FMT_RGB48LE},
+ {IMGFMT_RGB48_BE, PIX_FMT_RGB48BE},
{IMGFMT_ABGR, PIX_FMT_ABGR},
{IMGFMT_RGBA, PIX_FMT_RGBA},
{IMGFMT_RGB24, PIX_FMT_RGB24},
- {IMGFMT_RGB16BE, PIX_FMT_BGR565BE},
- {IMGFMT_RGB16LE, PIX_FMT_BGR565LE},
- {IMGFMT_RGB15BE, PIX_FMT_BGR555BE},
- {IMGFMT_RGB15LE, PIX_FMT_BGR555LE},
- {IMGFMT_RGB12BE, PIX_FMT_BGR444BE},
- {IMGFMT_RGB12LE, PIX_FMT_BGR444LE},
+ {IMGFMT_RGB16_BE, PIX_FMT_BGR565BE},
+ {IMGFMT_RGB16_LE, PIX_FMT_BGR565LE},
+ {IMGFMT_RGB15_BE, PIX_FMT_BGR555BE},
+ {IMGFMT_RGB15_LE, PIX_FMT_BGR555LE},
+ {IMGFMT_RGB12_BE, PIX_FMT_BGR444BE},
+ {IMGFMT_RGB12_LE, PIX_FMT_BGR444LE},
{IMGFMT_RGB8, PIX_FMT_BGR8},
{IMGFMT_RGB4, PIX_FMT_BGR4},
{IMGFMT_PAL8, PIX_FMT_PAL8},
{IMGFMT_GBRP, PIX_FMT_GBRP},
- {IMGFMT_YUY2, PIX_FMT_YUYV422},
+ {IMGFMT_YUYV, PIX_FMT_YUYV422},
{IMGFMT_UYVY, PIX_FMT_UYVY422},
{IMGFMT_NV12, PIX_FMT_NV12},
{IMGFMT_NV21, PIX_FMT_NV21},
- {IMGFMT_Y800, PIX_FMT_GRAY8},
{IMGFMT_Y8, PIX_FMT_GRAY8},
- {IMGFMT_Y16LE, PIX_FMT_GRAY16LE},
- {IMGFMT_Y16BE, PIX_FMT_GRAY16BE},
- {IMGFMT_YVU9, PIX_FMT_YUV410P},
- {IMGFMT_IF09, PIX_FMT_YUV410P},
- {IMGFMT_YV12, PIX_FMT_YUV420P},
- {IMGFMT_I420, PIX_FMT_YUV420P},
- {IMGFMT_IYUV, PIX_FMT_YUV420P},
+ {IMGFMT_Y16_LE, PIX_FMT_GRAY16LE},
+ {IMGFMT_Y16_BE, PIX_FMT_GRAY16BE},
+ {IMGFMT_410P, PIX_FMT_YUV410P},
+ {IMGFMT_420P, PIX_FMT_YUV420P},
{IMGFMT_411P, PIX_FMT_YUV411P},
{IMGFMT_422P, PIX_FMT_YUV422P},
{IMGFMT_444P, PIX_FMT_YUV444P},
{IMGFMT_440P, PIX_FMT_YUV440P},
- {IMGFMT_420A, PIX_FMT_YUVA420P},
+ {IMGFMT_420AP, PIX_FMT_YUVA420P},
{IMGFMT_420P16_LE, PIX_FMT_YUV420P16LE},
{IMGFMT_420P16_BE, PIX_FMT_YUV420P16BE},
@@ -95,10 +90,9 @@ static const struct {
{IMGFMT_444P16_LE, PIX_FMT_YUV444P16LE},
{IMGFMT_444P16_BE, PIX_FMT_YUV444P16BE},
- // YUVJ are YUV formats that use the full Y range and not just
- // 16 - 235 (see colorspaces.txt).
- // Currently they are all treated the same way.
- {IMGFMT_YV12, PIX_FMT_YUVJ420P},
+ // YUVJ are YUV formats that use the full Y range. Decoder color range
+ // information is used instead. Deprecated in ffmpeg.
+ {IMGFMT_420P, PIX_FMT_YUVJ420P},
{IMGFMT_422P, PIX_FMT_YUVJ422P},
{IMGFMT_444P, PIX_FMT_YUVJ444P},
{IMGFMT_440P, PIX_FMT_YUVJ440P},
diff --git a/video/image_writer.c b/video/image_writer.c
index 8d3b746ef7..3a25e91b07 100644
--- a/video/image_writer.c
+++ b/video/image_writer.c
@@ -215,16 +215,16 @@ static const struct img_writer img_writers[] = {
{ "ppm", write_lavc, .lavc_codec = CODEC_ID_PPM },
{ "pgm", write_lavc,