Skip to content

oapve param parse#55

Closed
kpchoi wants to merge 7 commits intomainfrom
xeve_param_parse
Closed

oapve param parse#55
kpchoi wants to merge 7 commits intomainfrom
xeve_param_parse

Conversation

@kpchoi
Copy link
Collaborator

@kpchoi kpchoi commented Mar 7, 2025

  • added oapve_param_parse() API.

mss-park and others added 4 commits March 7, 2025 14:42
Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com>
Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com>
Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com>
@kpchoi kpchoi requested a review from cpncf March 7, 2025 08:03
kpchoi added 2 commits March 7, 2025 17:22
Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com>
Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com>
@dkozinski
Copy link
Collaborator

Please change the name in the title of the pull request and in the commit message from "xeve" to "oapv."

Comment on lines 1515 to 1538
ENC_SET_PARAM_DATA(profile_idc, DT_INTEGER ),
ENC_SET_PARAM_DATA(level_idc, DT_INTEGER ),
ENC_SET_PARAM_DATA(band_idc, DT_INTEGER ),
ENC_SET_PARAM_DATA(w, DT_INTEGER ),
ENC_SET_PARAM_DATA(h, DT_INTEGER ),
ENC_SET_PARAM_DATA(fps_num, DT_INTEGER ),
ENC_SET_PARAM_DATA(fps_den, DT_INTEGER),
ENC_SET_PARAM_DATA(rc_type, DT_INTEGER ),
ENC_SET_PARAM_DATA(qp, DT_INTEGER ),
ENC_SET_PARAM_DATA(qp_offset_c1, DT_INTEGER ),
ENC_SET_PARAM_DATA(qp_offset_c2, DT_INTEGER ),
ENC_SET_PARAM_DATA(qp_offset_c3, DT_INTEGER ),
ENC_SET_PARAM_DATA(bitrate, DT_INTEGER ),
ENC_SET_PARAM_DATA(use_filler, DT_INTEGER ),
ENC_SET_PARAM_DATA(csp, DT_INTEGER ),
ENC_SET_PARAM_DATA(tile_cols, DT_INTEGER ),
ENC_SET_PARAM_DATA(tile_rows, DT_INTEGER ),
ENC_SET_PARAM_DATA(tile_w_mb, DT_INTEGER ),
ENC_SET_PARAM_DATA(tile_h_mb, DT_INTEGER ),
ENC_SET_PARAM_DATA(color_description_present_flag, DT_INTEGER ),
ENC_SET_PARAM_DATA(color_primaries, DT_INTEGER ),
ENC_SET_PARAM_DATA(transfer_characteristics, DT_INTEGER ),
ENC_SET_PARAM_DATA(matrix_coefficients, DT_INTEGER ),
ENC_SET_PARAM_DATA(full_range_flag, DT_INTEGER ),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are here is all required options are listed?
For example threads is missing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to add more variables.
Could you help to add "unsigned char q_matrix[OAPV_MAX_CC][OAPV_BLK_D];" option?

Copy link
Collaborator Author

@kpchoi kpchoi Mar 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And, some options are not listed in the oapve_param_t. like 'threads'. it is another issue.
Shall we move 'threads' variable to 'oapve_param_t' structure?

Copy link
Collaborator

@cpncf cpncf Mar 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about not supporting '-oapv-params' options?
Instead of it, we can add more AVOptions to support every options listed in oapve_params_t.
Before create new instance by calling oapve_create(), the member variables of oapve_params_t can be directly changed without any side-effect.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically, we could eliminate the '-oapv-params' option and map all codec parameters (fields of the oapve_param structure) to options (AVOption in the implementation of FFCodec ff_libapv_encoder) in FFmpeg. However, I am not sure if this is a good solution.

Let's assume that we map all OpenAPV codec parameters in ffapv to AVOptions.
In that case, if we want to provide access to all OAPV codec parameters from the FFmpeg side, it will require the maintainers of ffapv to continuously check for any changes in the OpenAPV library and synchronize those changes with FFmpeg.
After implementing changes in OAPV that require modifications on the FFmpeg side, we will have to wait for the corresponding changes to be made in FFmpeg, then go through the review process, be accepted by the FFmpeg community, and merged into the master branch of the FFmpeg project. As you can see, synchronization will involve a certain time overhead, which we will have little influence over due to the engagement of the FFmpeg community.

I think that the optimal solution is to map the most commonly used codec parameters to options in FFmpeg (as is currently the case) and allow the setting of any parameter through the OpenAPV library's API.

This means that the OpenAPV library should expose an API that allows setting all possible codec parameters (function int OAPV_EXPORT oapve_param_parse(oapve_param_t* param, const char* name, const char* value);).

Exposing the oapve_param_parse function in the OpenAPV library allows for setting all supported codec parameters using the -oapv-params option on the FFmpeg side.

This way, no changes in the OpenAPV library related to codec parameters will require reimplementation on the ffapv side.

Moreover, the FFmpeg user, by using the -oapv-params option, will be able to directly refer to the liboapv documentation when configuring codec parameters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will refactor many code for supporting oapve_param_parse() API.
And then I will commit PR again later.

@kpchoi kpchoi changed the title Xeve param parse oapve param parse Mar 8, 2025
@kpchoi kpchoi requested a review from dariusz-f March 8, 2025 00:23
Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com>
@kpchoi kpchoi closed this Mar 12, 2025
@kpchoi kpchoi deleted the xeve_param_parse branch March 12, 2025 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants