Skip to content

Commit 27d4d71

Browse files
authored
Kp refactoring cleanup 20260508 (#206)
* fixed wrong return error value Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com> * refactor and fix typo Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com> --------- Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com>
1 parent e4d4589 commit 27d4d71

7 files changed

Lines changed: 469 additions & 474 deletions

File tree

app/oapv_app_enc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ static const args_opt_t enc_args_opts[] = {
126126
ARGS_NO_KEY, "profile", ARGS_VAL_TYPE_STRING, 0, NULL,
127127
"profile string\n"
128128
" - 422-10: YCbCr422 10bit (default)\n"
129-
" - 422-12; YCbCr422 12bit\n"
129+
" - 422-12: YCbCr422 12bit\n"
130130
" - 444-10: YCbCr444 10bit\n"
131-
" - 444-12; YCbCr444 12bit\n"
131+
" - 444-12: YCbCr444 12bit\n"
132132
" - 4444-10: YCbCr4444 10bit\n"
133-
" - 4444-12; YCbCr4444 12bit\n"
133+
" - 4444-12: YCbCr4444 12bit\n"
134134
" - 400-10: YCbCr400 (monochrome) 10bit\n"
135135
" Note: Color space and bit depth of input video will be converted\n"
136136
" automatically to support the given profile, if needs\n"
@@ -485,7 +485,7 @@ static int check_conf(oapve_cdesc_t *cdesc, args_var_t *vars)
485485
}
486486
int p = get_val_from_key(oapv_param_opts_profile, vars->profile);
487487
if(p < 0) {
488-
logerr("ERR: invalid profile (%s)\n", vars->family);
488+
logerr("ERR: invalid profile (%s)\n", vars->profile);
489489
return -1;
490490
}
491491

@@ -732,7 +732,7 @@ static int update_param(args_var_t *vars, oapve_param_t *param)
732732
}
733733
int kbps = family_to_bitrate(vars->family, param);
734734
if(kbps < 0) {
735-
logerr("ERR: failed to get targe bitrate from family value\n");
735+
logerr("ERR: failed to get target bitrate from family value\n");
736736
return -1;
737737
}
738738
sprintf(vars->bitrate, "%d", kbps);
@@ -781,7 +781,7 @@ static int parse_master_display(const char* data_string, oapvm_payload_mdcv_t *m
781781
// Check if sscanf successfully assigned all expected fields (10 numerical values).
782782
const int expected_fields = 10;
783783
if (assigned_fields != expected_fields) {
784-
logerr("Parsing error: master diplay color volume information");
784+
logerr("Parsing error: master display color volume information");
785785
return -1;
786786
}
787787
return 0; // Success

inc/oapv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ struct oapv_imgb {
315315
int h[OAPV_MAX_CC];
316316
/* X position of left top (in unit of pixel) */
317317
int x[OAPV_MAX_CC];
318-
/* Y postion of left top (in unit of pixel) */
318+
/* Y position of left top (in unit of pixel) */
319319
int y[OAPV_MAX_CC];
320320
/* buffer stride (in unit of byte) */
321321
int s[OAPV_MAX_CC];

src/oapv.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static void imgb_pad(oapv_imgb_t *imgb, int aw, int ah, int comp_sft[N_C][2])
3636
int imgb_w = imgb->w[0];
3737
int imgb_h = imgb->h[0];
3838

39-
if(aw == imgb_w && ah == imgb_h) { // no needs to pad
39+
if(aw == imgb_w && ah == imgb_h) { // no need to pad
4040
return;
4141
}
4242

@@ -79,7 +79,7 @@ static void imgb_pad_p210(oapv_imgb_t *imgb, int aw, int ah, int comp_sft[N_C][2
7979
int imgb_w = imgb->w[0];
8080
int imgb_h = imgb->h[0];
8181

82-
if(aw == imgb_w && ah == imgb_h) { // no needs to pad
82+
if(aw == imgb_w && ah == imgb_h) { // no need to pad
8383
return;
8484
}
8585

@@ -703,7 +703,7 @@ static void enc_flush(oapve_ctx_t *ctx)
703703
ctx->tpool->release(&ctx->thread_id[i]);
704704
}
705705
}
706-
// dinitialize the tc
706+
// deinitialize the tc
707707
oapv_tpool_deinit(ctx->tpool);
708708
oapv_mfree_fast(ctx->tpool);
709709
ctx->tpool = NULL;
@@ -1083,7 +1083,7 @@ static int enc_frm_prepare(oapve_ctx_t *ctx, oapve_param_t *param, oapv_imgb_t *
10831083
ctx->core[i]->ctx = ctx;
10841084
ctx->core[i]->thread_idx = i;
10851085
}
1086-
// recontruction picture
1086+
// reconstruction picture
10871087
if(imgb_r != NULL) {
10881088
for(int c = 0; c < ctx->num_comp; c++) {
10891089
imgb_r->w[c] = imgb_i->w[c];
@@ -1608,7 +1608,7 @@ static int dec_frm_prepare(oapvd_ctx_t *ctx, oapv_imgb_t *imgb)
16081608

16091609
static void dec_frm_finish(oapvd_ctx_t *ctx)
16101610
{
1611-
imgb_release(ctx->imgb); // decrease reference cnout
1611+
imgb_release(ctx->imgb); // decrease reference count
16121612
ctx->imgb = NULL;
16131613
}
16141614

@@ -1807,7 +1807,7 @@ static void dec_flush(oapvd_ctx_t *ctx)
18071807
ctx->tpool->release(&ctx->thread_id[i]);
18081808
}
18091809
}
1810-
// dinitialize the tpool
1810+
// deinitialize the tpool
18111811
oapv_tpool_deinit(ctx->tpool);
18121812
oapv_mfree(ctx->tpool);
18131813
ctx->tpool = NULL;

src/oapv_bs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ void oapv_bsr_skip(oapv_bs_t *bs, int size)
232232

233233
void *oapv_bsr_sink(oapv_bs_t *bs)
234234
{
235-
oapv_assert_rv(bs->cur - BSW_GET_SINK_BYTE(bs) < bs->end, NULL);
236235
oapv_assert_rv((bs->leftbits & 7) == 0, NULL);
237236
bs->cur = bs->cur - (bs->leftbits >> 3);
238237
bs->code = 0;

src/oapv_metadata.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,38 +133,38 @@ static int meta_verify_mdp_data(int type, int size, u8 *data)
133133
{
134134
if(type == OAPV_METADATA_ITU_T_T35) {
135135
if(size == 0) {
136-
return OAPV_ERR_MALFORMED_BITSTREAM;
136+
return OAPV_ERR_INVALID_ARGUMENT;
137137
}
138138
if(*data == 0xFF) {
139139
if(size == 1) {
140-
return OAPV_ERR_MALFORMED_BITSTREAM;
140+
return OAPV_ERR_INVALID_ARGUMENT;
141141
}
142142
}
143143
}
144144
else if(type == OAPV_METADATA_MDCV) {
145145
if(size != 24) {
146-
return OAPV_ERR_MALFORMED_BITSTREAM;
146+
return OAPV_ERR_INVALID_ARGUMENT;
147147
}
148148
}
149149
else if(type == OAPV_METADATA_CLL) {
150150
if(size != 4) {
151-
return OAPV_ERR_MALFORMED_BITSTREAM;
151+
return OAPV_ERR_INVALID_ARGUMENT;
152152
}
153153
}
154154
else if(type == OAPV_METADATA_USER_DEFINED) {
155155
if(size < 16) {
156-
return OAPV_ERR_MALFORMED_BITSTREAM;
156+
return OAPV_ERR_INVALID_ARGUMENT;
157157
}
158158
}
159159
else if(type == OAPV_METADATA_FILLER) {
160160
for(int i = 0; i < size; i++) {
161161
if(data[i] != 0xFF) {
162-
return OAPV_ERR_MALFORMED_BITSTREAM;
162+
return OAPV_ERR_INVALID_ARGUMENT;
163163
}
164164
}
165165
}
166166
else {
167-
return OAPV_OK;
167+
return OAPV_OK; // undefined payload type
168168
}
169169
return OAPV_OK;
170170
}

0 commit comments

Comments
 (0)