Skip to content

added disable_raw_bitstream_format#85

Closed
kpchoi wants to merge 1 commit intomainfrom
support_non_raw_bitstream_format
Closed

added disable_raw_bitstream_format#85
kpchoi wants to merge 1 commit intomainfrom
support_non_raw_bitstream_format

Conversation

@kpchoi
Copy link
Collaborator

@kpchoi kpchoi commented May 8, 2025

Supports encoding output which doesn't have 'au_size' of 'raw bitstream format'.
It can be controlled by the 'disable_raw_bitstream_format' variable in oapve_cdesc_t structure.

Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com>
Copy link
Collaborator

@dkozinski dkozinski left a comment

Choose a reason for hiding this comment

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

What do you thing about using oapve_config() function to set encoder output format, as shown below

+/* bytestream format */
+#define OAPV_BF_RAW_BYTESTREAM_AU       (0)  // The output from the encoder is compliant with raw_bitstream_access_unit
+#define OAPV_BF_AU                      (1)  // The output from the encoder consists of access units that are not preceded by an access unit size
+
 /*****************************************************************************
  * config types
  *****************************************************************************/
@@ -152,6 +156,7 @@ extern "C" {
 #define OAPV_CFG_SET_QP_MIN             (208)
 #define OAPV_CFG_SET_QP_MAX             (209)
 #define OAPV_CFG_SET_USE_FRM_HASH       (301)
+#define OAPV_CFG_SET_ENC_OUTPUT_FORMAT  (302)
 #define OAPV_CFG_GET_QP_MIN             (600)
 #define OAPV_CFG_GET_QP_MAX             (601)
 #define OAPV_CFG_GET_QP                 (602)

@@ -1430,6 +1436,13 @@ int oapve_config(oapve_t eid, int cfg, void *buf, int *size)
         oapv_assert_rv(*size == sizeof(int), OAPV_ERR_INVALID_ARGUMENT);
         ctx->use_frm_hash = (*((int *)buf)) ? 1 : 0;
         break;
+    case OAPV_CFG_SET_ENC_OUTPUT_FORMAT:
+        oapv_assert_rv(*size == sizeof(int), OAPV_ERR_INVALID_ARGUMENT);
+        t0 = *((int *)buf);
+        oapv_assert_rv(t0 == OAPV_BF_RAW_BYTESTREAM_AU || t0 == OAPV_BF_AU, OAPV_ERR_INVALID_ARGUMENT);
+        ctx->encoder_output_format = t0;
+        break;

int full_range_flag;
};

#define OAPV_CDESC_THREADS_AUTO 0
Copy link
Contributor

Choose a reason for hiding this comment

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

This is unrelated to the PR, and strictly speaking an API break.

@kpchoi
Copy link
Collaborator Author

kpchoi commented May 9, 2025

What do you thing about using oapve_config() function to set encoder output format, as shown below

+/* bytestream format */
+#define OAPV_BF_RAW_BYTESTREAM_AU       (0)  // The output from the encoder is compliant with raw_bitstream_access_unit
+#define OAPV_BF_AU                      (1)  // The output from the encoder consists of access units that are not preceded by an access unit size
+
 /*****************************************************************************
  * config types
  *****************************************************************************/
@@ -152,6 +156,7 @@ extern "C" {
 #define OAPV_CFG_SET_QP_MIN             (208)
 #define OAPV_CFG_SET_QP_MAX             (209)
 #define OAPV_CFG_SET_USE_FRM_HASH       (301)
+#define OAPV_CFG_SET_ENC_OUTPUT_FORMAT  (302)
 #define OAPV_CFG_GET_QP_MIN             (600)
 #define OAPV_CFG_GET_QP_MAX             (601)
 #define OAPV_CFG_GET_QP                 (602)

@@ -1430,6 +1436,13 @@ int oapve_config(oapve_t eid, int cfg, void *buf, int *size)
         oapv_assert_rv(*size == sizeof(int), OAPV_ERR_INVALID_ARGUMENT);
         ctx->use_frm_hash = (*((int *)buf)) ? 1 : 0;
         break;
+    case OAPV_CFG_SET_ENC_OUTPUT_FORMAT:
+        oapv_assert_rv(*size == sizeof(int), OAPV_ERR_INVALID_ARGUMENT);
+        t0 = *((int *)buf);
+        oapv_assert_rv(t0 == OAPV_BF_RAW_BYTESTREAM_AU || t0 == OAPV_BF_AU, OAPV_ERR_INVALID_ARGUMENT);
+        ctx->encoder_output_format = t0;
+        break;

I think this method would be more easy to understand. I will close this PR and raise again.

@kpchoi kpchoi closed this May 9, 2025
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.

3 participants