mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 22:23:14 -04:00
msm: vidc: add lossless encoding capability
1. Define lossless capability upto 4096x2304@60fps; 2. Check capability when starting the streaming; Change-Id: Iaa737aca6132b27a22a4e80a7d8eddfd83360b23 Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
This commit is contained in:
parent
ab390d0f2d
commit
1332222345
3 changed files with 38 additions and 0 deletions
|
|
@ -1552,6 +1552,26 @@ static void handle_session_init_done(enum hal_command_response cmd, void *data)
|
|||
print_cap("b_qp", &inst->capability.cap[CAP_B_FRAME_QP]);
|
||||
print_cap("slice_bytes", &inst->capability.cap[CAP_SLICE_BYTE]);
|
||||
print_cap("slice_mbs", &inst->capability.cap[CAP_SLICE_MB]);
|
||||
print_cap("max_videocores", &inst->capability.cap[CAP_MAX_VIDEOCORES]);
|
||||
/* Secure usecase specific */
|
||||
print_cap("secure_width",
|
||||
&inst->capability.cap[CAP_SECURE_FRAME_WIDTH]);
|
||||
print_cap("secure_height",
|
||||
&inst->capability.cap[CAP_SECURE_FRAME_HEIGHT]);
|
||||
print_cap("secure_mbs_per_frame",
|
||||
&inst->capability.cap[CAP_SECURE_MBS_PER_FRAME]);
|
||||
print_cap("secure_bitrate", &inst->capability.cap[CAP_SECURE_BITRATE]);
|
||||
/* Batch Mode Decode */
|
||||
print_cap("batch_mbs_per_frame",
|
||||
&inst->capability.cap[CAP_BATCH_MAX_MB_PER_FRAME]);
|
||||
print_cap("batch_frame_rate", &inst->capability.cap[CAP_BATCH_MAX_FPS]);
|
||||
/* Lossless encoding usecase specific */
|
||||
print_cap("lossless_width",
|
||||
&inst->capability.cap[CAP_LOSSLESS_FRAME_WIDTH]);
|
||||
print_cap("lossless_height",
|
||||
&inst->capability.cap[CAP_LOSSLESS_FRAME_HEIGHT]);
|
||||
print_cap("lossless_mbs_per_frame",
|
||||
&inst->capability.cap[CAP_LOSSLESS_MBS_PER_FRAME]);
|
||||
|
||||
msm_vidc_comm_update_ctrl_limits(inst);
|
||||
|
||||
|
|
@ -5656,6 +5676,15 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
|
|||
mbpf_max = capability->cap[CAP_MBS_PER_FRAME].max;
|
||||
}
|
||||
|
||||
if (inst->session_type == MSM_VIDC_ENCODER &&
|
||||
inst->rc_type == RATE_CONTROL_LOSSLESS) {
|
||||
width_min = capability->cap[CAP_LOSSLESS_FRAME_WIDTH].min;
|
||||
width_max = capability->cap[CAP_LOSSLESS_FRAME_WIDTH].max;
|
||||
height_min = capability->cap[CAP_LOSSLESS_FRAME_HEIGHT].min;
|
||||
height_max = capability->cap[CAP_LOSSLESS_FRAME_HEIGHT].max;
|
||||
mbpf_max = capability->cap[CAP_LOSSLESS_MBS_PER_FRAME].max;
|
||||
}
|
||||
|
||||
f = &inst->fmts[OUTPUT_PORT].v4l2_fmt;
|
||||
output_height = f->fmt.pix_mp.height;
|
||||
output_width = f->fmt.pix_mp.width;
|
||||
|
|
|
|||
|
|
@ -344,6 +344,12 @@ static struct msm_vidc_codec_capability kona_capabilities[] = {
|
|||
{CAP_BATCH_MAX_MB_PER_FRAME, DEC, CODECS_ALL, 64, 34560, 1, 34560},
|
||||
/* (4096 * 2160) / 256 */
|
||||
{CAP_BATCH_MAX_FPS, DEC, CODECS_ALL, 1, 120, 1, 120},
|
||||
|
||||
/* Lossless encoding usecase specific */
|
||||
{CAP_LOSSLESS_FRAME_WIDTH, ENC, H264|HEVC, 128, 4096, 1, 1920},
|
||||
{CAP_LOSSLESS_FRAME_HEIGHT, ENC, H264|HEVC, 128, 4096, 1, 1080},
|
||||
/* (4096 * 2304) / 256 */
|
||||
{CAP_LOSSLESS_MBS_PER_FRAME, ENC, H264|HEVC, 64, 36864, 1, 36864},
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -280,6 +280,9 @@ enum hal_capability {
|
|||
CAP_SECURE_BITRATE,
|
||||
CAP_BATCH_MAX_MB_PER_FRAME,
|
||||
CAP_BATCH_MAX_FPS,
|
||||
CAP_LOSSLESS_FRAME_WIDTH,
|
||||
CAP_LOSSLESS_FRAME_HEIGHT,
|
||||
CAP_LOSSLESS_MBS_PER_FRAME,
|
||||
CAP_MAX,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue