summaryrefslogtreecommitdiffstats
path: root/libhb/common.h
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-08-22 20:33:35 +0000
committerRodeo <[email protected]>2013-08-22 20:33:35 +0000
commitd41905d539046445e1b81499ff7bd04d170c91d4 (patch)
tree3f39a09e757bca8bc461d46303a2cb1c35e8d9a6 /libhb/common.h
parentc1a493b581f0567eba92625f2ee132de8e7f1d6d (diff)
Big merge, QSV to trunk: part 1 (tracked files).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5737 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.h')
-rw-r--r--libhb/common.h47
1 files changed, 45 insertions, 2 deletions
diff --git a/libhb/common.h b/libhb/common.h
index 5a21eab84..38c97e487 100644
--- a/libhb/common.h
+++ b/libhb/common.h
@@ -105,6 +105,15 @@ typedef struct hb_lock_s hb_lock_t;
#include "audio_remap.h"
#include "libavutil/channel_layout.h"
+#ifdef USE_QSV
+
+#ifndef DEBUG_ASSERT
+#define DEBUG_ASSERT(x,y) { if ((x)) { hb_error("ASSERT: %s", y); exit(1); } }
+#endif
+
+#include "libavcodec/qsv.h"
+#endif
+
hb_list_t * hb_list_init();
int hb_list_count( const hb_list_t * );
void hb_list_add( hb_list_t *, void * );
@@ -403,12 +412,15 @@ struct hb_job_s
pass: 0, 1 or 2 (or -1 for scan)
advanced_opts: string of extra advanced encoder options
areBframes: boolean to note if b-frames are included in advanced_opts */
-#define HB_VCODEC_MASK 0x00000FF
+#define HB_VCODEC_MASK 0x0000FFF
#define HB_VCODEC_X264 0x0000001
#define HB_VCODEC_THEORA 0x0000002
#define HB_VCODEC_FFMPEG_MPEG4 0x0000010
#define HB_VCODEC_FFMPEG_MPEG2 0x0000020
#define HB_VCODEC_FFMPEG_MASK 0x00000F0
+#define HB_VCODEC_QSV_H264 0x0000100
+#define HB_VCODEC_QSV_MASK 0x0000F00
+#define HB_VCODEC_H264_MASK (HB_VCODEC_X264|HB_VCODEC_QSV_H264)
int vcodec;
float vquality;
@@ -500,6 +512,21 @@ struct hb_job_s
uint32_t frames_to_skip; // decode but discard this many frames
// initially (for frame accurate positioning
// to non-I frames).
+#ifdef USE_QSV
+ av_qsv_context *qsv;
+ int qsv_decode;
+ int qsv_async_depth;
+ // shared encoding parameters
+ // initialized by the QSV encoder, then used upstream (e.g. by filters) to
+ // configure their output so that it corresponds to what the encoder expects
+ struct
+ {
+ int pic_struct;
+ int align_width;
+ int align_height;
+ int is_init_done;
+ } qsv_enc_info;
+#endif
#ifdef __LIBHB__
/* Internal data */
@@ -833,6 +860,10 @@ struct hb_title_s
char *container_name;
int data_rate;
+#ifdef USE_QSV
+ int qsv_decode_support;
+#endif
+
hb_metadata_t *metadata;
hb_list_t * list_chapter;
@@ -929,6 +960,9 @@ typedef struct hb_work_info_s
int color_prim;
int color_transfer;
int color_matrix;
+#ifdef USE_QSV
+ int qsv_decode_support;
+#endif
};
struct
{ // info only valid for audio decoders
@@ -998,6 +1032,7 @@ extern hb_work_object_t hb_dectx3gsub;
extern hb_work_object_t hb_decssasub;
extern hb_work_object_t hb_decpgssub;
extern hb_work_object_t hb_encavcodec;
+extern hb_work_object_t hb_encqsv;
extern hb_work_object_t hb_encx264;
extern hb_work_object_t hb_enctheora;
extern hb_work_object_t hb_deca52;
@@ -1076,8 +1111,11 @@ struct hb_filter_object_s
enum
{
+ // for QSV - important to have before other filters
+ HB_FILTER_QSV_PRE = 1,
+
// First, filters that may change the framerate (drop or dup frames)
- HB_FILTER_DETELECINE = 1,
+ HB_FILTER_DETELECINE,
HB_FILTER_DECOMB,
HB_FILTER_DEINTERLACE,
HB_FILTER_VFR,
@@ -1089,6 +1127,11 @@ enum
// Finally filters that don't care what order they are in,
// except that they must be after the above filters
HB_FILTER_ROTATE,
+
+ // for QSV - important to have as a last one
+ HB_FILTER_QSV_POST,
+ // default MSDK VPP filter
+ HB_FILTER_QSV,
};
hb_filter_object_t * hb_filter_init( int filter_id );