summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoyuan Zhang <boyuan.zhang@amd.com>2018-01-25 14:32:04 -0500
committerLeo Liu <leo.liu@amd.com>2018-02-05 09:16:18 -0500
commit66087d8a2d20fc46dfac68229563602050a95217 (patch)
tree0fbeb4b4ae9e324abf70c611be8c435688372357
parenta9c0861c6c4e26207b8e2fc18f6efd824e92d960 (diff)
st/va: enable dual instances encode only for H264
Logics that related to dual instances encode should only be done for H264, not other codecs. Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com> Acked-by: Christian König <christian.koenig@amd.com>
-rw-r--r--src/gallium/state_trackers/va/picture.c3
-rw-r--r--src/gallium/state_trackers/va/surface.c23
2 files changed, 15 insertions, 11 deletions
diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c
index 7c72188c2d0..a3cbf98fd03 100644
--- a/src/gallium/state_trackers/va/picture.c
+++ b/src/gallium/state_trackers/va/picture.c
@@ -617,7 +617,8 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
}
context->decoder->end_frame(context->decoder, context->target, &context->desc.base);
- if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
+ if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE &&
+ u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC) {
int idr_period = context->desc.h264enc.gop_size / context->gop_coeff;
int p_remain_in_idr = idr_period - context->desc.h264enc.frame_num;
surf->frame_num_cnt = context->desc.h264enc.frame_num_cnt;
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
index 636505b720e..9823232413f 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -36,6 +36,7 @@
#include "util/u_rect.h"
#include "util/u_sampler.h"
#include "util/u_surface.h"
+#include "util/u_video.h"
#include "vl/vl_compositor.h"
#include "vl/vl_video_buffer.h"
@@ -122,16 +123,18 @@ vlVaSyncSurface(VADriverContextP ctx, VASurfaceID render_target)
}
if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
- int frame_diff;
- if (context->desc.h264enc.frame_num_cnt >= surf->frame_num_cnt)
- frame_diff = context->desc.h264enc.frame_num_cnt - surf->frame_num_cnt;
- else
- frame_diff = 0xFFFFFFFF - surf->frame_num_cnt + 1 + context->desc.h264enc.frame_num_cnt;
- if ((frame_diff == 0) &&
- (surf->force_flushed == false) &&
- (context->desc.h264enc.frame_num_cnt % 2 != 0)) {
- context->decoder->flush(context->decoder);
- context->first_single_submitted = true;
+ if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC) {
+ int frame_diff;
+ if (context->desc.h264enc.frame_num_cnt >= surf->frame_num_cnt)
+ frame_diff = context->desc.h264enc.frame_num_cnt - surf->frame_num_cnt;
+ else
+ frame_diff = 0xFFFFFFFF - surf->frame_num_cnt + 1 + context->desc.h264enc.frame_num_cnt;
+ if ((frame_diff == 0) &&
+ (surf->force_flushed == false) &&
+ (context->desc.h264enc.frame_num_cnt % 2 != 0)) {
+ context->decoder->flush(context->decoder);
+ context->first_single_submitted = true;
+ }
}
context->decoder->get_feedback(context->decoder, surf->feedback, &(surf->coded_buf->coded_size));
surf->feedback = NULL;