* [FFmpeg-devel] [PATCH 1/2] avcodec/dv: Remove unnecessary header
@ 2022-07-04 9:13 Andreas Rheinhardt
2022-07-04 9:16 ` [FFmpeg-devel] [PATCH 2/2] avcodec/dvenc: Don't set chroma_sample_location Andreas Rheinhardt
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Rheinhardt @ 2022-07-04 9:13 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Forgotten in 6d484671ecb612c32cbda0fab65f961743aff5f8.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/dv.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/libavcodec/dv.h b/libavcodec/dv.h
index 19290aa382..855afcc758 100644
--- a/libavcodec/dv.h
+++ b/libavcodec/dv.h
@@ -30,7 +30,6 @@
#include "avcodec.h"
#include "dv_profile.h"
#include "me_cmp.h"
-#include "vlc.h"
#include "idctdsp.h"
typedef struct DVwork_chunk {
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] avcodec/dvenc: Don't set chroma_sample_location
2022-07-04 9:13 [FFmpeg-devel] [PATCH 1/2] avcodec/dv: Remove unnecessary header Andreas Rheinhardt
@ 2022-07-04 9:16 ` Andreas Rheinhardt
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Rheinhardt @ 2022-07-04 9:16 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
The documentation specifies that it is set by the user
for encoders. Given that ff_dvvideo_init() is so extremely simple,
the fix consists of inlining the function into its two callers,
with setting chroma_sample_location omitted in dvenc.c.
This unfortunately leads to the color siting element written
in the mxf_dv25 test being unknown.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/dv.c | 13 ++-----------
libavcodec/dv.h | 2 --
libavcodec/dvdec.c | 5 ++++-
libavcodec/dvenc.c | 4 +++-
tests/ref/lavf/mxf_dv25 | 2 +-
5 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/libavcodec/dv.c b/libavcodec/dv.c
index e2550c4cc1..731e6227cd 100644
--- a/libavcodec/dv.c
+++ b/libavcodec/dv.c
@@ -38,8 +38,9 @@
* DV codec.
*/
-#include "avcodec.h"
+#include "libavutil/pixfmt.h"
#include "dv.h"
+#include "dv_profile.h"
static inline void dv_calc_mb_coordinates(const AVDVProfile *d, int chan,
int seq, int slot, uint16_t *tbl)
@@ -184,13 +185,3 @@ int ff_dv_init_dynamic_tables(DVVideoContext *ctx, const AVDVProfile *d)
return 0;
}
-
-av_cold int ff_dvvideo_init(AVCodecContext *avctx)
-{
- DVVideoContext *s = avctx->priv_data;
-
- s->avctx = avctx;
- avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
-
- return 0;
-}
diff --git a/libavcodec/dv.h b/libavcodec/dv.h
index 855afcc758..f8f1c0c283 100644
--- a/libavcodec/dv.h
+++ b/libavcodec/dv.h
@@ -97,8 +97,6 @@ enum dv_pack_type {
int ff_dv_init_dynamic_tables(DVVideoContext *s, const AVDVProfile *d);
-int ff_dvvideo_init(AVCodecContext *avctx);
-
static inline int dv_work_pool_size(const AVDVProfile *d)
{
int size = d->n_difchan * d->difseg_size * 27;
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index d6f073058c..b282705653 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -240,6 +240,9 @@ static av_cold int dvvideo_decode_init(AVCodecContext *avctx)
DVVideoContext *s = avctx->priv_data;
int i;
+ s->avctx = avctx;
+ avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
+
ff_idctdsp_init(&s->idsp, avctx);
for (i = 0; i < 64; i++)
@@ -258,7 +261,7 @@ static av_cold int dvvideo_decode_init(AVCodecContext *avctx)
ff_thread_once(&init_static_once, dv_init_static);
- return ff_dvvideo_init(avctx);
+ return 0;
}
/* decode AC coefficients */
diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index 2922829dc5..5108c3d2e7 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -55,6 +55,8 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
PixblockDSPContext pdsp;
int ret;
+ s->avctx = avctx;
+
s->sys = av_dv_codec_profile2(avctx->width, avctx->height, avctx->pix_fmt, avctx->time_base);
if (!s->sys) {
av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video. "
@@ -91,7 +93,7 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
}
#endif
- return ff_dvvideo_init(avctx);
+ return 0;
}
/* bit budget for AC only in 5 MBs */
diff --git a/tests/ref/lavf/mxf_dv25 b/tests/ref/lavf/mxf_dv25
index 5022f1f62d..95a58906a0 100644
--- a/tests/ref/lavf/mxf_dv25
+++ b/tests/ref/lavf/mxf_dv25
@@ -1,3 +1,3 @@
-3339def72599c79ad5860c6860cc3123 *tests/data/lavf/lavf.mxf_dv25
+59d632e097e6f45c28445b2ab862ffe8 *tests/data/lavf/lavf.mxf_dv25
3834413 tests/data/lavf/lavf.mxf_dv25
tests/data/lavf/lavf.mxf_dv25 CRC=0xbdaf7f52
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-04 9:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04 9:13 [FFmpeg-devel] [PATCH 1/2] avcodec/dv: Remove unnecessary header Andreas Rheinhardt
2022-07-04 9:16 ` [FFmpeg-devel] [PATCH 2/2] avcodec/dvenc: Don't set chroma_sample_location Andreas Rheinhardt
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git