Skip to content

Commit

Permalink
Some more testing on Ingenic
Browse files Browse the repository at this point in the history
  • Loading branch information
wberube committed Jun 1, 2024
1 parent f9ad778 commit 3214c71
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 45 deletions.
27 changes: 10 additions & 17 deletions src/hal/inge/t31_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ int t31_channel_bind(char index)

{
t31_sys_bind source = { .device = T31_SYS_DEV_FS, .group = index, .port = 0 };
t31_sys_bind dest = { .device = T31_SYS_DEV_OSD, .group = _t31_osd_grp, .port = 0 };
t31_sys_bind dest = { .device = T31_SYS_DEV_OSD, .group = _t31_osd_grp, .port = index };
if (ret = t31_sys.fnBind(&source, &dest))
return ret;
}

{
t31_sys_bind source = { .device = T31_SYS_DEV_OSD, .group = _t31_osd_grp, .port = 0 };
t31_sys_bind source = { .device = T31_SYS_DEV_OSD, .group = _t31_osd_grp, .port = index };
t31_sys_bind dest = { .device = T31_SYS_DEV_ENC, .group = index, .port = 0 };
if (ret = t31_sys.fnBind(&source, &dest))
return ret;
Expand All @@ -114,8 +114,6 @@ int t31_channel_create(char index, short width, short height, char framerate)
{
t31_fs_chn channel = {
.dest = { .width = width, .height = height }, .pixFmt = T31_PIXFMT_NV12,
.crop = { .enable = 0, .left = 0, .top = 0, .width = _t31_snr_dim.width,
.height = _t31_snr_dim.height },
.scale = { .enable = (_t31_snr_dim.width != width || _t31_snr_dim.height != height)
? 1 : 0, .width = width, .height = height },
.fpsDen = framerate, .fpsNum = 1, .bufCount = 1, .phyOrExtChn = 0,
Expand Down Expand Up @@ -145,14 +143,14 @@ int t31_channel_unbind(char index)
t31_fs.fnDisableChannel(index);

{
t31_sys_bind source = { .device = T31_SYS_DEV_OSD, .group = _t31_osd_grp, .port = 0 };
t31_sys_bind source = { .device = T31_SYS_DEV_OSD, .group = _t31_osd_grp, .port = index };
t31_sys_bind dest = { .device = T31_SYS_DEV_ENC, .group = index, .port = 0 };
t31_sys.fnUnbind(&source, &dest);
}

{
t31_sys_bind source = { .device = T31_SYS_DEV_FS, .group = index, .port = 0 };
t31_sys_bind dest = { .device = T31_SYS_DEV_OSD, .group = _t31_osd_grp, .port = 0 };
t31_sys_bind dest = { .device = T31_SYS_DEV_OSD, .group = _t31_osd_grp, .port = index };
t31_sys.fnUnbind(&source, &dest);
}

Expand Down Expand Up @@ -253,14 +251,13 @@ int t31_video_create(char index, hal_vidconfig *config)
channel.rate.cbr = (t31_venc_rate_cbr){ .tgtBitrate = MAX(config->bitrate,
config->maxBitrate), .initQual = -1, .minQual = 34, .maxQual = 51,
.ipDelta = -1, .pbDelta = -1, .options = T31_VENC_RCOPT_SCN_CHG_RES |
T31_VENC_RCOPT_SC_PREVENTION, .maxPicSize = MAX(config->bitrate,
config->maxBitrate) / 4 * 3 }; break;
T31_VENC_RCOPT_SC_PREVENTION, .maxPicSize = config->width }; break;
case HAL_VIDMODE_VBR:
channel.rate.mode = T31_VENC_RATEMODE_VBR;
channel.rate.vbr = (t31_venc_rate_vbr){ .tgtBitrate = config->bitrate,
.maxBitrate = config->maxBitrate, .initQual = -1, .minQual = 34, .maxQual = 51,
.ipDelta = -1, .pbDelta = -1, .options = T31_VENC_RCOPT_SCN_CHG_RES |
T31_VENC_RCOPT_SC_PREVENTION , .maxPicSize = config->maxBitrate }; break;
T31_VENC_RCOPT_SC_PREVENTION, .maxPicSize = config->width }; break;
case HAL_VIDMODE_QP:
channel.rate.mode = T31_VENC_RATEMODE_QP;
channel.rate.qpModeQual = config->maxQual; break;
Expand All @@ -269,8 +266,7 @@ int t31_video_create(char index, hal_vidconfig *config)
channel.rate.avbr = (t31_venc_rate_xvbr){ .tgtBitrate = config->bitrate,
.maxBitrate = config->maxBitrate, .initQual = -1, .minQual = 34, .maxQual = 51,
.ipDelta = -1, .pbDelta = -1, .options = T31_VENC_RCOPT_SCN_CHG_RES |
T31_VENC_RCOPT_SC_PREVENTION, .maxPicSize = config->maxBitrate,
.maxPsnr = 42 }; break;
T31_VENC_RCOPT_SC_PREVENTION, .maxPicSize = config->width, .maxPsnr = 42 }; break;
default:
T31_ERROR("Video encoder does not support this mode!");
}
Expand All @@ -285,12 +281,9 @@ int t31_video_create(char index, hal_vidconfig *config)
if (ret = t31_venc.fnRegisterChannel(index, index))
return ret;

{
int count = -1;
if (config->codec != HAL_VIDCODEC_JPG &&
(ret = t31_venc.fnStartReceiving(index)))
return ret;
}
if (config->codec != HAL_VIDCODEC_JPG &&
(ret = t31_venc.fnStartReceiving(index)))
return ret;

t31_state[index].payload = config->codec;

Expand Down
56 changes: 28 additions & 28 deletions src/hal/inge/t31_isp.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,34 @@ typedef struct {
} t31_isp_snr;

static t31_common_dim t31_dims[] = {
{ .height = 1920, .width = 1080 }, // c23a98
{ .height = 2560, .width = 1440 }, // c4390
{ .height = 1280, .width = 720 }, // gc1034
{ .height = 1920, .width = 1080 }, // gc2053
{ .height = 2560, .width = 1440 }, // gc4653
{ .height = 1920, .width = 1080 }, // imx307
{ .height = 1920, .width = 1080 }, // imx327
{ .height = 2592, .width = 1944 }, // imx335
{ .height = 1920, .width = 1080 }, // jxf23
{ .height = 1920, .width = 1080 }, // jxf37
{ .height = 1280, .width = 720 }, // jxh62
{ .height = 2592, .width = 1944 }, // jxk03
{ .height = 2560, .width = 1920 }, // jxk05
{ .height = 2304, .width = 1296 }, // jxq03
{ .height = 1920, .width = 1080 }, // os02k10
{ .height = 2560, .width = 1440 }, // os04b10
{ .height = 2592, .width = 1944 }, // os05a10
{ .height = 2592, .width = 1944 }, // ov5648
{ .height = 1920, .width = 1080 }, // sc2232h
{ .height = 1920, .width = 1080 }, // sc2235
{ .height = 1920, .width = 1080 }, // sc2239
{ .height = 1920, .width = 1080 }, // sc2310
{ .height = 1920, .width = 1080 }, // sc2315
{ .height = 1920, .width = 1080 }, // sc2335
{ .height = 2304, .width = 1296 }, // sc3235
{ .height = 2304, .width = 1296 }, // sc3335
{ .height = 2560, .width = 1440 }, // sc4335
{ .height = 2560, .width = 1920 } // sc5235
{ .width = 1920, .height = 1080 }, // c23a98
{ .width = 2560, .height = 1440 }, // c4390
{ .width = 1280, .height = 720 }, // gc1034
{ .width = 1920, .height = 1080 }, // gc2053
{ .width = 2560, .height = 1440 }, // gc4653
{ .width = 1920, .height = 1080 }, // imx307
{ .width = 1920, .height = 1080 }, // imx327
{ .width = 2592, .height = 1944 }, // imx335
{ .width = 1920, .height = 1080 }, // jxf23
{ .width = 1920, .height = 1080 }, // jxf37
{ .width = 1280, .height = 720 }, // jxh62
{ .width = 2592, .height = 1944 }, // jxk03
{ .width = 2560, .height = 1920 }, // jxk05
{ .width = 2304, .height = 1296 }, // jxq03
{ .width = 1920, .height = 1080 }, // os02k10
{ .width = 2560, .height = 1440 }, // os04b10
{ .width = 2592, .height = 1944 }, // os05a10
{ .width = 2592, .height = 1944 }, // ov5648
{ .width = 1920, .height = 1080 }, // sc2232h
{ .width = 1920, .height = 1080 }, // sc2235
{ .width = 1920, .height = 1080 }, // sc2239
{ .width = 1920, .height = 1080 }, // sc2310
{ .width = 1920, .height = 1080 }, // sc2315
{ .width = 1920, .height = 1080 }, // sc2335
{ .width = 2304, .height = 1296 }, // sc3235
{ .width = 2304, .height = 1296 }, // sc3335
{ .width = 2560, .height = 1440 }, // sc4335
{ .width = 2560, .height = 1920 } // sc5235
};

static t31_isp_snr t31_sensors[] = {
Expand Down

0 comments on commit 3214c71

Please sign in to comment.