Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added input full range option in VPP 3DLUT sample. #268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions videoprocess/process_3dlut.cfg.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SRC_FRAME_WIDTH: 1920
SRC_FRAME_HEIGHT: 1080
SRC_FRAME_FORMAT: P010
SRC_FILE_FORMAT: P010
SRC_FULL_RANGE: 0

#2.Destination YUV(RGB) file information
DST_FILE_NAME: ./out_1920x1080.p010
Expand Down
17 changes: 16 additions & 1 deletion videoprocess/vpp3dlut.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2021, Intel Corporation
* Copyright (c) 2009-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -90,6 +90,8 @@ static uint16_t g_3dlut_seg_size = 65;
static uint16_t g_3dlut_mul_size = 128;
static uint32_t g_3dlut_channel_mapping = 1;

static uint32_t g_input_full_range = 0;

#if VA_CHECK_VERSION(1, 12, 0)

static int8_t
Expand Down Expand Up @@ -1143,6 +1145,8 @@ video_frame_process_3dlut(VASurfaceID in_surface_id,
pipeline_param.surface_color_standard = VAProcColorStandardBT2020;
pipeline_param.output_color_standard = VAProcColorStandardBT709;

pipeline_param.input_color_properties.color_range = (g_input_full_range) ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;

va_status = vaCreateBuffer(va_dpy,
context_id,
VAProcPipelineParameterBufferType,
Expand Down Expand Up @@ -1423,6 +1427,10 @@ parse_basic_parameters()
read_value_string(g_config_file_fd, "SRC_FRAME_FORMAT", str);
parse_fourcc_and_format(str, &g_in_fourcc, &g_in_format);

if (read_value_uint32(g_config_file_fd, "SRC_FULL_RANGE", &g_input_full_range)) {
printf("Read source full range failed, exit.");
}

/* Read dst frame file information */
read_value_string(g_config_file_fd, "DST_FILE_NAME", g_dst_file_name);
read_value_uint32(g_config_file_fd, "DST_FRAME_WIDTH", &g_out_pic_width);
Expand Down Expand Up @@ -1554,4 +1562,11 @@ int32_t main(int32_t argc, char *argv[])
return 0;
}

#else

int32_t main(int32_t argc, char *argv[])
{
return 0;
}

#endif