[IEP] remove warnings during iep2 library build.

Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
Change-Id: I5f0d8ae75350d0401f28a1945c9dc1397bbd626d
This commit is contained in:
Alpha Lin
2020-07-24 15:35:21 +08:00
committed by Herman Chen
parent d9cce8d0e1
commit 9523c81879
6 changed files with 17 additions and 9 deletions

View File

@@ -624,6 +624,7 @@ static iep_com_ops iep_ops = {
.init = iep_init,
.deinit = iep_deinit,
.control = iep_control,
.release = NULL
};
iep_com_ctx* rockchip_iep_api_alloc_ctx(void)

View File

@@ -455,6 +455,7 @@ static iep_com_ops iep2_ops = {
.init = iep2_init,
.deinit = iep2_deinit,
.control = iep2_control,
.release = NULL,
};
iep_com_ctx* rockchip_iep2_api_alloc_ctx(void)

View File

@@ -26,7 +26,7 @@
#include "iep2_api.h"
void iep2_sort(uint32_t bin[], int map[], int size)
void iep2_sort(uint32_t bin[], uint32_t map[], int size)
{
int i, m, n;
uint32_t *dat = malloc(size * sizeof(uint32_t));
@@ -62,7 +62,7 @@ static int iep2_osd_check(int8_t *mv, int w, int sx, int ex, int sy, int ey,
{
/* (28 + 27) * 4 + 1 */
uint32_t hist[221];
int map[221];
uint32_t map[221];
int total = (ey - sy + 1) * (ex - sx + 1);
int non_zero = 0;
int domin = 0;
@@ -73,7 +73,7 @@ static int iep2_osd_check(int8_t *mv, int w, int sx, int ex, int sy, int ey,
for (i = sy; i <= ey; ++i) {
for (j = sx; j <= ex; ++j) {
int8_t v = mv[i * w + j];
int idx = v + 28 * 4;
uint32_t idx = v + 28 * 4;
if (idx >= MPP_ARRAY_ELEMS(hist)) {
mpp_log("invalid mv at (%d, %d)\n", j, i);
@@ -90,7 +90,7 @@ static int iep2_osd_check(int8_t *mv, int w, int sx, int ex, int sy, int ey,
domin = hist[map[0]];
if (map[0] + 1 < MPP_ARRAY_ELEMS(hist))
domin += hist[map[0] + 1];
if (map[0] - 1 >= 0)
if (map[0] >= 1)
domin += hist[map[0] - 1];
printf("total tiles in current osd: %d, non-zero %d\n",

View File

@@ -79,7 +79,7 @@ void iep2_check_pd(struct iep2_api_ctx *ctx)
int ff00b = (ctx->output.dect_ff_cur_bcnt << 5) / bdiff;
int nz = ctx->output.dect_ff_nz + 1;
int f = ctx->output.dect_ff_comb_f;
int i, j;
size_t i, j;
pd_inf->spatial[idx] = RKMIN(ff00t, ff00b);
pd_inf->temporal[idx] = (tcnt < 32) | ((bcnt < 32) << 1);
@@ -109,8 +109,8 @@ void iep2_check_pd(struct iep2_api_ctx *ctx)
pd_inf->fcoeff[4]);
if (pd_inf->pdtype != PD_TYPES_UNKNOWN && pd_inf->step != -1) {
int i = (int)pd_inf->pdtype;
int type = pd_table[i][(pd_inf->step + 1) % 5];
int n = (int)pd_inf->pdtype;
int type = pd_table[n][(pd_inf->step + 1) % 5];
if ((type == PD_TS && !(tcnt < 32)) ||
(type == PD_BS && !(bcnt < 32))) {
@@ -208,7 +208,7 @@ int iep2_pd_get_output(struct iep2_pd_info *pd_inf)
case PD_TYPES_2_3_3_2:
switch (step) {
case 2:
PD_COMP_FLAG_NON;
flag = PD_COMP_FLAG_NON;
break;
}
break;

View File

@@ -110,6 +110,7 @@ typedef struct iep_com_ctx_t {
struct dev_compatible {
const char *compatible;
iep_com_ctx* (*get)(void);
void (*put)(iep_com_ctx *ctx);
int ver;
};

View File

@@ -26,11 +26,13 @@ struct dev_compatible dev_comp[] = {
{
.compatible = "/dev/iep",
.get = rockchip_iep_api_alloc_ctx,
.put = rockchip_iep_api_release_ctx,
.ver = 1,
},
{
.compatible = "/dev/mpp_service",
.get = rockchip_iep2_api_alloc_ctx,
.put = rockchip_iep2_api_release_ctx,
.ver = 2,
},
};
@@ -46,6 +48,8 @@ iep_com_ctx* get_iep_ctx()
ctx->ver = dev_comp[i].ver;
mpp_log("device %s select in vproc\n", dev_comp[i].compatible);
ctx->ops->release = dev_comp[i].put;
return ctx;
}
}
@@ -55,6 +59,7 @@ iep_com_ctx* get_iep_ctx()
void put_iep_ctx(iep_com_ctx *ictx)
{
ictx->ops->release(ictx);
if (ictx->ops->release)
ictx->ops->release(ictx);
}