aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/include
diff options
context:
space:
mode:
authorChristian König <[email protected]>2013-07-15 09:16:22 -0600
committerChristian König <[email protected]>2014-02-11 13:26:13 +0100
commitee978aee94d98fec669002eb5ef7ceb1f46683a9 (patch)
treea60768c696b3f23ce696a43da44d51012e60db34 /src/gallium/include
parenteaf3358e0a1323ed417b6875e70fdcdc30ed97e0 (diff)
vl: add H264 encoding interface
Signed-off-by: Christian König <[email protected]> Signed-off-by: Leo Liu <[email protected]>
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/p_video_codec.h13
-rw-r--r--src/gallium/include/pipe/p_video_enums.h4
-rw-r--r--src/gallium/include/pipe/p_video_state.h45
3 files changed, 60 insertions, 2 deletions
diff --git a/src/gallium/include/pipe/p_video_codec.h b/src/gallium/include/pipe/p_video_codec.h
index 0e3827a0eac..d4cdacb9cef 100644
--- a/src/gallium/include/pipe/p_video_codec.h
+++ b/src/gallium/include/pipe/p_video_codec.h
@@ -87,6 +87,14 @@ struct pipe_video_codec
const unsigned *sizes);
/**
+ * encode to a bitstream
+ */
+ void (*encode_bitstream)(struct pipe_video_codec *codec,
+ struct pipe_video_buffer *source,
+ struct pipe_resource *destination,
+ void **feedback);
+
+ /**
* end decoding of the current frame
*/
void (*end_frame)(struct pipe_video_codec *codec,
@@ -98,6 +106,11 @@ struct pipe_video_codec
* should be called before a video_buffer is acessed by the state tracker again
*/
void (*flush)(struct pipe_video_codec *codec);
+
+ /**
+ * get encoder feedback
+ */
+ void (*get_feedback)(struct pipe_video_codec *codec, void *feedback, unsigned *size);
};
/**
diff --git a/src/gallium/include/pipe/p_video_enums.h b/src/gallium/include/pipe/p_video_enums.h
index 7ec29c033f4..10205ac4411 100644
--- a/src/gallium/include/pipe/p_video_enums.h
+++ b/src/gallium/include/pipe/p_video_enums.h
@@ -72,8 +72,8 @@ enum pipe_video_entrypoint
PIPE_VIDEO_ENTRYPOINT_UNKNOWN,
PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
PIPE_VIDEO_ENTRYPOINT_IDCT,
- PIPE_VIDEO_ENTRYPOINT_MC
+ PIPE_VIDEO_ENTRYPOINT_MC,
+ PIPE_VIDEO_ENTRYPOINT_ENCODE
};
-
#endif /* PIPE_VIDEO_ENUMS_H */
diff --git a/src/gallium/include/pipe/p_video_state.h b/src/gallium/include/pipe/p_video_state.h
index 79e588fa2a0..f9721dca05b 100644
--- a/src/gallium/include/pipe/p_video_state.h
+++ b/src/gallium/include/pipe/p_video_state.h
@@ -110,6 +110,24 @@ enum pipe_h264_slice_type
PIPE_H264_SLICE_TYPE_SI = 0x4
};
+enum pipe_h264_enc_picture_type
+{
+ PIPE_H264_ENC_PICTURE_TYPE_P = 0x00,
+ PIPE_H264_ENC_PICTURE_TYPE_B = 0x01,
+ PIPE_H264_ENC_PICTURE_TYPE_I = 0x02,
+ PIPE_H264_ENC_PICTURE_TYPE_IDR = 0x03,
+ PIPE_H264_ENC_PICTURE_TYPE_SKIP = 0x04
+};
+
+enum pipe_h264_enc_rate_control_method
+{
+ PIPE_H264_ENC_RATE_CONTROL_METHOD_DISABLE = 0x00,
+ PIPE_H264_ENC_RATE_CONTROL_METHOD_CONSTANT_SKIP = 0x01,
+ PIPE_H264_ENC_RATE_CONTROL_METHOD_VARIABLE_SKIP = 0x02,
+ PIPE_H264_ENC_RATE_CONTROL_METHOD_CONSTANT = 0x03,
+ PIPE_H264_ENC_RATE_CONTROL_METHOD_VARIABLE = 0x04
+};
+
struct pipe_picture_desc
{
enum pipe_video_profile profile;
@@ -325,6 +343,33 @@ struct pipe_h264_picture_desc
struct pipe_video_buffer *ref[16];
};
+struct pipe_h264_enc_rate_control
+{
+ enum pipe_h264_enc_rate_control_method rate_ctrl_method;
+ unsigned target_bitrate;
+ unsigned peak_bitrate;
+ unsigned frame_rate_num;
+ unsigned frame_rate_den;
+ unsigned vbv_buffer_size;
+ unsigned target_bits_picture;
+ unsigned peak_bits_picture_integer;
+ unsigned peak_bits_picture_fraction;
+};
+
+struct pipe_h264_enc_picture_desc
+{
+ struct pipe_picture_desc base;
+
+ struct pipe_h264_enc_rate_control rate_ctrl;
+
+ unsigned quant_i_frames;
+ unsigned quant_p_frames;
+ unsigned quant_b_frames;
+
+ enum pipe_h264_enc_picture_type picture_type;
+ unsigned frame_num;
+};
+
#ifdef __cplusplus
}
#endif