summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-01-25 12:24:03 -0700
committerJohn Stebbins <[email protected]>2016-02-15 12:38:13 -0700
commit1e4f868915edd738e56f82a67ea1443b953b373a (patch)
tree50bf7224effca06cf540fd2f48580b331d620ab3 /libhb
parent7e5bbec56e9ee7b47d54d6e8ebfe912467479608 (diff)
deinterlace: add conditional deinterlacing of interlaced frames
Only deinterlace frames that are marked as interlaced when mode HB_YADIF_AUTO is set in the filter settings. Currently, this would cause no frames to be deinterlaced since all frames are marked non-interlaced. This option will become useful in a subsequent patch that splits comb detection into it's own filter.
Diffstat (limited to 'libhb')
-rw-r--r--libhb/avfilter.c9
-rw-r--r--libhb/internal.h5
-rw-r--r--libhb/param.c6
3 files changed, 15 insertions, 5 deletions
diff --git a/libhb/avfilter.c b/libhb/avfilter.c
index 4c1f1d165..a865d6305 100644
--- a/libhb/avfilter.c
+++ b/libhb/avfilter.c
@@ -335,11 +335,12 @@ static void fill_frame(hb_filter_private_t * pv,
frame->linesize[1] = buf->plane[1].stride;
frame->linesize[2] = buf->plane[2].stride;
- frame->pts = buf->s.start;
+ frame->pts = buf->s.start;
frame->reordered_opaque = buf->s.start;
- frame->width = buf->f.width;
- frame->height = buf->f.height;
- frame->format = buf->f.fmt;
+ frame->width = buf->f.width;
+ frame->height = buf->f.height;
+ frame->format = buf->f.fmt;
+ frame->interlaced_frame = !!buf->s.combed;
}
static hb_buffer_t* avframe_to_buffer(hb_filter_private_t * pv, AVFrame *frame)
diff --git a/libhb/internal.h b/libhb/internal.h
index a4c0eb5b0..9ad22507f 100644
--- a/libhb/internal.h
+++ b/libhb/internal.h
@@ -102,6 +102,11 @@ struct hb_buffer_settings_s
#define PIC_FLAG_REPEAT_FRAME 0x0200
#define HB_BUF_FLAG_EOF 0x0400
uint16_t flags;
+
+#define HB_COMB_NONE 0
+#define HB_COMB_LIGHT 1
+#define HB_COMB_HEAVY 2
+ uint8_t combed;
};
struct hb_image_format_s
diff --git a/libhb/param.c b/libhb/param.c
index 3a9402021..f9ec82092 100644
--- a/libhb/param.c
+++ b/libhb/param.c
@@ -108,6 +108,7 @@ static filter_param_map_t param_map[] =
#define MODE_YADIF_ENABLE 1
#define MODE_YADIF_SPATIAL 2
#define MODE_YADIF_BOB 4
+#define MODE_YADIF_AUTO 8
/* Deinterlace Settings
* mode:parity
@@ -119,6 +120,7 @@ static filter_param_map_t param_map[] =
* 1 = Enabled
* 2 = Spatial
* 4 = Bob
+ * 8 = Auto
*
* Parity:
* 0 = Top Field First
@@ -149,11 +151,13 @@ generate_deinterlace_settings(const char * settings)
{
return (char*)hb_filter_off;
}
+ int automatic = !!(mode & MODE_YADIF_AUTO);
int bob = !!(mode & MODE_YADIF_BOB);
int no_spatial = !(mode & MODE_YADIF_SPATIAL);
mode = bob | (no_spatial << 1);
- return hb_strdup_printf("yadif='mode=%d:parity=%d'", mode, parity);
+ return hb_strdup_printf("yadif='mode=%d:auto=%d:parity=%d'",
+ mode, automatic, parity);
}
/* Rotate Settings: