Skip to content

Commit 5affa4d

Browse files
committed
vdec/lavc: accept corrupted for all except MJPEG
Retestd with MJPEG, VP9, AV1 and HEVC and except the first one all (AV1 is indecisive) seem to produce better results. Tested with: ``` tc qdisc replace dev lo root netem loss 0.1% uv -t testcard:patt=text:s=1280x720 -c lavc:c=CODEC -d gl ``` and with `--param lavd-accept-corrupted[=no]` Namely HEVC seem to produce significantly better results (often avoiding the intra refresh wave). This may be revided later (HW decoders, disabled intra refresh with H.265 and so).
1 parent 13c2e6a commit 5affa4d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/video_decompress/libavcodec.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Martin Pulec <[email protected]>
44
*/
55
/*
6-
* Copyright (c) 2013-2024 CESNET, z. s. p. o.
6+
* Copyright (c) 2013-2025 CESNET
77
* All rights reserved.
88
*
99
* Redistribution and use in source and binary forms, with or without
@@ -1145,20 +1145,18 @@ ADD_TO_PARAM("lavd-accept-corrupted",
11451145
"* lavd-accept-corrupted[=no]\n"
11461146
" Pass corrupted frames to decoder. If decoder isn't error-resilient,\n"
11471147
" may crash! Use \"no\" to disable even if enabled by default.\n");
1148+
/// if not requesteed, disable just for MJPEG
11481149
static bool
11491150
accept_corrupted(const AVCodecContext *ctx)
11501151
{
11511152
const char *const val = get_commandline_param("lavd-accept-corrupted");
11521153
if (val != NULL) {
11531154
return strcmp(val, "no") != 0;
11541155
}
1155-
if (ctx == NULL) {
1156+
if (ctx == NULL && ctx->codec->id == AV_CODEC_ID_MJPEG) {
11561157
return false;
11571158
}
1158-
if (ctx->codec->id == AV_CODEC_ID_H264) {
1159-
return true;
1160-
}
1161-
return false;
1159+
return true;
11621160
}
11631161

11641162
static int libavcodec_decompress_get_property(void *state, int property, void *val, size_t *len)

0 commit comments

Comments
 (0)