1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

37 Commits

Author SHA1 Message Date
Anton Khirnov
0ed1eeb744 lavf/dv: use a more granular timebase for audio
One that is fine enough to represent all DV audio sample rates. Audio
packet durations are now sample-accurate.

This largely undoes commit 76fbb0052d. To
avoid breaking the issue fixed by that commit, resync audio timestamps
against video if they get more than one frame apart. The sample from
issue #8762 still works correctly after this commit.

Slightly changes the results of the lavf-dv seektest, due to the audio
timebase being more granular.
2023-05-02 10:57:21 +02:00
Anton Khirnov
c7a852b638 lavf/dv: do not set video timebase more than once
Current code will call avpriv_set_pts_info() for each video frame,
possibly setting a different timebase if the stream framerate changes.
This violates API conventions, as the timebase is supposed to stay
constant after stream creation.

Change the demuxer to set a single timebase that is fine enough to
handle all supported DV framerates.

The seek tests change slightly because the new timebase is more
granular.
2023-05-02 10:57:21 +02:00
Anton Khirnov
f7b3fc4afe lavc/dv: rename constants to follow our naming conventions
CamelCase for enum tags, ALL_CAPS for enum values.
2022-09-05 08:10:26 +02:00
Anton Khirnov
7203bb6a59 lavc/dv.h: move encoder/decoder-specific code to a new header
dv.h is also used by libavformat, so avoid exposing encoder/decoder code
to it.
2022-09-05 08:09:00 +02:00
Anton Khirnov
828ec6ef43 lavc/dvenc: stop using DVVideoContext
Move the parts of it used by the encoder into a new DVEncContext and
remove DVVideoContext.
2022-09-05 08:08:08 +02:00
Anton Khirnov
69bad628ec lavc/dv: do not pass DVVideoContext to dv_calculate_mb_xy()
Pass the two variables needed from it directly.

This is done in preparation to splitting DVVideoContext.
2022-09-05 08:06:57 +02:00
Anton Khirnov
91c51dac6d lavc/dv: do not pass DVVideoContext to ff_dv_init_dynamic_tables()
It only needs work_chunks from it, so pass that directly.

This is done in preparation to splitting DVVideoContext.
2022-09-05 08:06:35 +02:00
Anton Khirnov
d1ba5d883e lavc/dv: remove ff_dvvideo_init()
The function contains only two assignments, setting DVVideoContext.avctx
and AVCodecContext.chroma_sample_location. However, the decoder does not
use the former, and the encoder should not be setting the latter.

Therefore move the first assignment to dvenc and the second to dvdec.
Make the encoder warn if the user-signalled chroma sample location does
not match the supported one, and return an error on higher compliance
levels.
2022-09-05 08:02:28 +02:00
Andreas Rheinhardt
597dc96736 avcodec/dvdec: Constify slice threads' ptr to main context
Modifying the main context from a slice thread is (usually)
a data race, so it must not happen. So only use a pointer to const
to access the main context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-31 04:38:20 +02:00
Andreas Rheinhardt
3524e82a08 avcodec/dv: Remove unnecessary header
Forgotten in 6d484671ec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:06:47 +02:00
Andreas Rheinhardt
6d484671ec avcodec/dv: Don't initialize RL VLC for encoder
Said RL VLC is only used by the decoder, ergo don't initialize it for
the encoder and move the whole code and the RL VLC table itself to
dvdec.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-05-06 06:13:54 +02:00
Baptiste Coudurier
a1403032c8 avcodec/dvenc: support encoding dvcprohd 2019-11-13 09:08:43 -08:00
Baptiste Coudurier
004ebd4b37 avcodec/dvdec: correctly decode bottom mb row in 1080i field mode 2019-11-06 08:40:36 -08:00
Michael Niedermayer
fea7bc9e7b avcodec/dvenc: Support adjusting the quantizer deadzone
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-08 19:39:10 +02:00
James Almer
5a49097b42 Merge commit '2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428'
* commit '2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428':
  idct: Change type of array stride parameters to ptrdiff_t

Merged-by: James Almer <jamrial@gmail.com>
2017-03-21 14:29:52 -03:00
Clément Bœsch
e07fa3008b Merge commit 'de452e503734ebb0fdbce86e9d16693b3530fad3'
* commit 'de452e503734ebb0fdbce86e9d16693b3530fad3':
  pixblockdsp: Change type of stride parameters to ptrdiff_t

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-20 15:58:32 +01:00
Diego Biurrun
2ec9fa5ec6 idct: Change type of array stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
2016-09-29 14:48:03 +02:00
Diego Biurrun
de452e5037 pixblockdsp: Change type of stride parameters to ptrdiff_t
This avoids SIMD-optimized functions having to sign-extend their
line size argument manually to be able to do pointer arithmetic.

Also adjust parameter names to be "stride" everywhere.
2016-09-14 14:12:36 +02:00
Clément Bœsch
9b35242370 Merge commit 'b7f98659f21dce438c33b512e25fd64b8d07c347'
* commit 'b7f98659f21dce438c33b512e25fd64b8d07c347':
  Remove unnecessary get_bits.h #includes

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-29 11:16:01 +02:00
Diego Biurrun
b7f98659f2 Remove unnecessary get_bits.h #includes 2016-06-07 13:09:57 +02:00
Hendrik Leppkes
d0186a4ec4 Merge commit 'cab63a8b594cdc365bb2581a12b3ac8e6dd480b2'
* commit 'cab63a8b594cdc365bb2581a12b3ac8e6dd480b2':
  dv: Mark internal frame reference as const

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-05 11:21:23 +02:00
Vittorio Giovara
cab63a8b59 dv: Mark internal frame reference as const
Silence a warning due to frame assignment in dvenc. All uses of the
reference in dvdec are read only, except the ones in the main decoding
function, so use the frame pointer directly there.
2015-10-04 13:06:34 +02:00
Christophe Gisquet
4fa772acbb dv: increase VLC reading bits to 10
This also requires a bump in the table size of bit patterns to 1664.
From 356 to 348 cycles.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-28 12:22:03 +01:00
Christophe Gisquet
05da586fef dv: move inverse weight tables to decoder
The encoder has its own tables and does not access the idct_factor
member of the DVVideoContext structure.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-26 19:21:59 +01:00
Michael Niedermayer
96b069450c Merge commit 'ee0ebd3c1412fdd9d80aa97c98d1a20b893f1f47'
* commit 'ee0ebd3c1412fdd9d80aa97c98d1a20b893f1f47':
  dv: K&R formatting cosmetics

Conflicts:
	libavcodec/dv.c
	libavcodec/dv.h
	libavcodec/dv_profile.c
	libavcodec/dvdec.c
	libavcodec/dvenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-09 19:30:55 +02:00
Gabriel Dume
ee0ebd3c14 dv: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-09 05:30:28 -07:00
Michael Niedermayer
305f72aee7 avcodec: Change get_pixels() to ptrdiff_t linesize
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-06 15:50:54 +02:00
Michael Niedermayer
3a2d1465c8 Merge commit '2d60444331fca1910510038dd3817bea885c2367'
* commit '2d60444331fca1910510038dd3817bea885c2367':
  dsputil: Split motion estimation compare bits off into their own context

Conflicts:
	configure
	libavcodec/Makefile
	libavcodec/arm/Makefile
	libavcodec/dvenc.c
	libavcodec/error_resilience.c
	libavcodec/h264.h
	libavcodec/h264_slice.c
	libavcodec/me_cmp.c
	libavcodec/me_cmp.h
	libavcodec/motion_est.c
	libavcodec/motion_est_template.c
	libavcodec/mpeg4videoenc.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/x86/Makefile
	libavcodec/x86/me_cmp_init.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-17 23:27:40 +02:00
Diego Biurrun
2d60444331 dsputil: Split motion estimation compare bits off into their own context 2014-07-17 09:07:10 -07:00
Michael Niedermayer
1b58f13761 Merge commit 'f6ee61fb05482c617f5deee29a190d8ff483b3d1'
* commit 'f6ee61fb05482c617f5deee29a190d8ff483b3d1':
  lavc: export DV profile API used by muxer/demuxer as public

Conflicts:
	configure
	doc/APIchanges
	libavcodec/Makefile
	libavcodec/dv_profile.c
	libavcodec/dv_profile.h
	libavcodec/version.h
	libavformat/dvenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-09 22:27:07 +02:00
Anton Khirnov
f6ee61fb05 lavc: export DV profile API used by muxer/demuxer as public 2014-07-09 13:35:07 +00:00
Michael Niedermayer
b0fdc76600 Merge commit '650dee63c8b1e6693c6cf5983f4a5ed3f571379f'
* commit '650dee63c8b1e6693c6cf5983f4a5ed3f571379f':
  dv: get rid of global non-const tables

Conflicts:
	libavcodec/dv_profile.h
	libavcodec/dvdec.c
	libavcodec/dvenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 18:00:42 +02:00
Anton Khirnov
650dee63c8 dv: get rid of global non-const tables
Instead, store them in the context and compute on each parameter change.
2014-06-20 14:15:31 +02:00
Michael Niedermayer
94a849b8b6 Merge commit 'd4f1188d1a662fed5347e70016da49e01563e8a8'
* commit 'd4f1188d1a662fed5347e70016da49e01563e8a8':
  dv: use AVFrame API properly

Conflicts:
	libavcodec/dvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-09 20:10:15 +01:00
Anton Khirnov
d4f1188d1a dv: use AVFrame API properly 2013-12-09 09:10:14 +01:00
Michael Niedermayer
e28130bcaf Merge commit '3cbe1126530449336e2ce59b194bdb8c4eb4abb4'
* commit '3cbe1126530449336e2ce59b194bdb8c4eb4abb4':
  dv: Split DV data table declarations into their own header

Conflicts:
	libavcodec/dvdata.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-15 12:52:19 +01:00
Diego Biurrun
3cbe112653 dv: Split DV data table declarations into their own header
This is necessary to avoid target config settings bleeding into the host
compilation process with hardcoded tables and the DV VLC tables no longer
present as static tables in a header file.
2013-11-15 01:29:47 +01:00