Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dcafba5 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: add lossless encoding capability"

parents 2999a5c6 13322223
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -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);

@@ -5658,6 +5678,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;
+6 −0
Original line number Diff line number Diff line
@@ -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},
};

/*
+3 −0
Original line number Diff line number Diff line
@@ -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,
};