mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-21 00:58:17 +07:00
[media] coda: add sequence counter offset
The coda h.264 decoder also counts PIC_RUNs where no frame was decoded but a frame was rotated out / marked as ready to be displayed. This causes an offset between the incoming encoded frame's sequence number and the decode sequence number returned by the coda. This patch introduces a sequence counter offset variable to keep track of the difference. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This commit is contained in:
parent
410e5e4938
commit
cb2c02821c
@ -222,6 +222,7 @@ struct coda_ctx {
|
|||||||
u32 isequence;
|
u32 isequence;
|
||||||
u32 qsequence;
|
u32 qsequence;
|
||||||
u32 osequence;
|
u32 osequence;
|
||||||
|
u32 sequence_offset;
|
||||||
struct coda_q_data q_data[2];
|
struct coda_q_data q_data[2];
|
||||||
enum coda_inst_type inst_type;
|
enum coda_inst_type inst_type;
|
||||||
struct coda_codec *codec;
|
struct coda_codec *codec;
|
||||||
@ -2621,6 +2622,7 @@ static void coda_stop_streaming(struct vb2_queue *q)
|
|||||||
ctx->streamon_cap = 0;
|
ctx->streamon_cap = 0;
|
||||||
|
|
||||||
ctx->osequence = 0;
|
ctx->osequence = 0;
|
||||||
|
ctx->sequence_offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ctx->streamon_out && !ctx->streamon_cap) {
|
if (!ctx->streamon_out && !ctx->streamon_cap) {
|
||||||
@ -3126,7 +3128,9 @@ static void coda_finish_decode(struct coda_ctx *ctx)
|
|||||||
|
|
||||||
if (decoded_idx == -1) {
|
if (decoded_idx == -1) {
|
||||||
/* no frame was decoded, but we might have a display frame */
|
/* no frame was decoded, but we might have a display frame */
|
||||||
if (display_idx < 0 && ctx->display_idx < 0)
|
if (display_idx >= 0 && display_idx < ctx->num_internal_frames)
|
||||||
|
ctx->sequence_offset++;
|
||||||
|
else if (ctx->display_idx < 0)
|
||||||
ctx->prescan_failed = true;
|
ctx->prescan_failed = true;
|
||||||
} else if (decoded_idx == -2) {
|
} else if (decoded_idx == -2) {
|
||||||
/* no frame was decoded, we still return the remaining buffers */
|
/* no frame was decoded, we still return the remaining buffers */
|
||||||
@ -3138,10 +3142,11 @@ static void coda_finish_decode(struct coda_ctx *ctx)
|
|||||||
struct coda_timestamp, list);
|
struct coda_timestamp, list);
|
||||||
list_del(&ts->list);
|
list_del(&ts->list);
|
||||||
val = coda_read(dev, CODA_RET_DEC_PIC_FRAME_NUM) - 1;
|
val = coda_read(dev, CODA_RET_DEC_PIC_FRAME_NUM) - 1;
|
||||||
if (val != ts->sequence) {
|
val -= ctx->sequence_offset;
|
||||||
|
if (val != (ts->sequence & 0xffff)) {
|
||||||
v4l2_err(&dev->v4l2_dev,
|
v4l2_err(&dev->v4l2_dev,
|
||||||
"sequence number mismatch (%d != %d)\n",
|
"sequence number mismatch (%d(%d) != %d)\n",
|
||||||
val, ts->sequence);
|
val, ctx->sequence_offset, ts->sequence);
|
||||||
}
|
}
|
||||||
ctx->frame_timestamps[decoded_idx] = *ts;
|
ctx->frame_timestamps[decoded_idx] = *ts;
|
||||||
kfree(ts);
|
kfree(ts);
|
||||||
|
Loading…
Reference in New Issue
Block a user