dst[15] = 0x50;
}
-u_int32 insert_scode_4_seq(struct vpu_ctx *ctx, u_int8 *src, u_int8 *dst, u_int32 vdec_std, u_int32 uPayloadSize, u_int32 *sin_seq)
+u_int32 single_seq_info_format(struct queue_data *q_data)
+{
+ u_int32 ret = 0;
+
+ switch (q_data->fourcc) {
+ case V4L2_PIX_FMT_VC1_ANNEX_G:
+ case V4L2_PIX_FMT_VC1_ANNEX_L:
+ case VPU_PIX_FMT_RV:
+ case V4L2_PIX_FMT_MPEG4:
+ case V4L2_PIX_FMT_MPEG2:
+ ret = 1;
+ break;
+ default:
+ break;
+ }
+
+ return ret;
+}
+
+u_int32 insert_scode_4_seq(struct vpu_ctx *ctx, u_int8 *src, u_int8 *dst, u_int32 vdec_std, u_int32 uPayloadSize)
{
struct queue_data *q_data = &ctx->q_data[V4L2_SRC];
u_int32 length = 0;
HeaderLen = RCV_HEADER_LEN - 4;
memcpy(dst + 16, Header, HeaderLen);
length += HeaderLen;
- *sin_seq = 1;
} else {
u_int8 Header[VC1_MAX_SEQ_HEADER_SIZE];
u_int32 HeaderLen;
HeaderLen -= 4;
memcpy(dst, Header, HeaderLen);
length += HeaderLen;
- *sin_seq = 1;
}
}
case VPU_VIDEO_VP6: {
vp6_scd_sequence_header(dst, q_data->width, q_data->height);
length = 16;
- *sin_seq = 1;
}
break;
case VPU_VIDEO_VP8: {
length += 8;
memcpy(dst+length, src, uPayloadSize);
length += uPayloadSize;
- *sin_seq = 0;
}
break;
case VPU_VIDEO_ASP: {
length = 16;
memcpy(dst+length, src, uPayloadSize);
length += uPayloadSize;
- *sin_seq = 0;
}
}
break;
length += 16;
memcpy(dst+length, src, uPayloadSize);
length += uPayloadSize;
- *sin_seq = 0;
}
break;
case VPU_VIDEO_RV: {
length = 16;
memcpy(dst+length, src, uPayloadSize);
length += uPayloadSize;
- *sin_seq = 1;
}
break;
default:
#define VC1_MAX_SEQ_HEADER_SIZE 256
u_int32 insert_scode_4_pic(struct vpu_ctx *ctx, u_int8 *dst, u_int8 *src, u_int32 vdec_std, u_int32 uPayloadSize);
-u_int32 insert_scode_4_seq(struct vpu_ctx *ctx, u_int8 *src, u_int8 *dst, u_int32 vdec_std, u_int32 uPayloadSize, u_int32 *sin_seq);
+u_int32 insert_scode_4_seq(struct vpu_ctx *ctx, u_int8 *src, u_int8 *dst, u_int32 vdec_std, u_int32 uPayloadSize);
u_int32 insert_scode_4_arv_slice(struct vpu_ctx *ctx, u_int8 *dst, struct VPU_FMT_INFO_ARV *arv_frame, u_int32 uPayloadSize);
struct VPU_FMT_INFO_ARV *get_arv_info(struct vpu_ctx *ctx, u_int8 *src, u_int32 size);
void put_arv_info(struct VPU_FMT_INFO_ARV *arv_frame);
void insert_payload_header_arv(u_int8 *dst, u_int32 uScodeType,
enum ARV_FRAME_TYPE type, u_int32 uPayloadSize, u_int32 uWidth, u_int32 uHeight);
+u_int32 single_seq_info_format(struct queue_data *q_data);
#endif
unsigned int *CurrStrfg = &pSharedInterface->StreamConfig[ctx->str_index];
u_int32 length;
MediaIPFW_Video_CodecParams *pCodecPara;
- u_int32 sin_seq = 0;
+ struct queue_data *q_data = &ctx->q_data[V4L2_SRC];
vpu_dbg(LVL_BIT_FUNC, "enter %s, start_flag %d, index=%d, firmware_started=%d\n",
__func__, ctx->start_flag, ctx->str_index, ctx->dev->firmware_started);
return 0;
}
if (!ctx->start_code_bypass)
- length = insert_scode_4_seq(ctx, input_buffer, ctx->stream_buffer.dma_virt, vdec_std, buffer_size, &sin_seq);
+ length = insert_scode_4_seq(ctx, input_buffer, ctx->stream_buffer.dma_virt, vdec_std, buffer_size);
else
length = 0;
if (length == 0) {
ctx->dev->shared_mem.pSharedInterface->DbgLogDesc.uDecStatusLogLevel = vpu_frmdbg_level;
/*initialize frame count*/
- if (sin_seq == 1) {
+ if (single_seq_info_format(q_data)) {
ctx->frm_dis_delay = 0;
ctx->frm_dec_delay = 0;
ctx->frm_total_num = 0;
return length;
}
-static bool check_single_seq_info(struct vb2_v4l2_buffer *vbuf, unsigned int vdec_std)
+static u_int32 check_single_seq_info(struct vb2_v4l2_buffer *vbuf, struct queue_data *q_data)
{
if (!(vbuf->flags & V4L2_NXP_BUF_FLAG_CODECCONFIG))
- return false;
- if (vdec_std == VPU_VIDEO_VC1 || vdec_std == VPU_VIDEO_VP6 || VPU_VIDEO_RV)
- return true;
-
- return false;
+ return 0;
+ return single_seq_info_format(q_data);
}
static bool verify_decoded_frames(struct vpu_ctx *ctx)
record_log_info(ctx, LOG_PADDING, 0, 0);
}
- if (!check_single_seq_info(vbuf, This->vdec_std)) {
+ if (!check_single_seq_info(vbuf, This)) {
ctx->frm_dec_delay++;
ctx->frm_dis_delay++;
ctx->frm_total_num++;