mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
[mpi_enc_test]: add slt testcase
slt verify file: mpi_enc_test -w 4096 -h 2304 -t 7 -slt enc_xxx.verify -n 5 mpi_dec_test -i <inputfile> -t 7 -slt dec_xxx.verify -n 5 Change-Id: I528fcd8d1adf8821c1555790cd8482108f219fdc Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
This commit is contained in:
@@ -53,6 +53,7 @@ typedef struct {
|
||||
// src and dst
|
||||
FILE *fp_input;
|
||||
FILE *fp_output;
|
||||
FILE *fp_verify;
|
||||
|
||||
/* encoder config set */
|
||||
MppEncCfg cfg;
|
||||
@@ -196,6 +197,10 @@ MPP_RET test_ctx_init(MpiEncMultiCtxInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
p->fp_verify = fopen(cmd->file_slt, "wt");
|
||||
if (!p->fp_verify)
|
||||
mpp_err("failed to open verify file %s\n", cmd->file_slt);
|
||||
|
||||
// update resource parameter
|
||||
switch (p->fmt & MPP_FRAME_FMT_MASK) {
|
||||
case MPP_FMT_YUV420SP:
|
||||
@@ -489,8 +494,12 @@ MPP_RET test_mpp_run(MpiEncMultiCtxInfo *info)
|
||||
RK_U32 quiet = cmd->quiet;
|
||||
RK_S32 chn = info->chn;
|
||||
RK_U32 cap_num = 0;
|
||||
DataCrc checkcrc;
|
||||
MPP_RET ret = MPP_OK;
|
||||
|
||||
memset(&checkcrc, 0, sizeof(checkcrc));
|
||||
checkcrc.sum = mpp_malloc(RK_ULONG, 512);
|
||||
|
||||
if (p->type == MPP_VIDEO_CodingAVC || p->type == MPP_VIDEO_CodingHEVC) {
|
||||
MppPacket packet = NULL;
|
||||
|
||||
@@ -716,6 +725,12 @@ MPP_RET test_mpp_run(MpiEncMultiCtxInfo *info)
|
||||
if (p->fp_output)
|
||||
fwrite(ptr, 1, len, p->fp_output);
|
||||
|
||||
if (p->fp_verify && !p->pkt_eos) {
|
||||
calc_data_crc((RK_U8 *)ptr, (RK_U32)len, &checkcrc);
|
||||
mpp_log("p->frame_count=%d, len=%d\n", p->frame_count, len);
|
||||
write_data_crc(p->fp_verify, &checkcrc);
|
||||
}
|
||||
|
||||
log_len += snprintf(log_buf + log_len, log_size - log_len,
|
||||
"encoded frame %-4d", p->frame_count);
|
||||
|
||||
@@ -778,6 +793,8 @@ MPP_RET test_mpp_run(MpiEncMultiCtxInfo *info)
|
||||
break;
|
||||
}
|
||||
RET:
|
||||
MPP_FREE(checkcrc.sum);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user