hevc: simplify SAO computation, delay from one row its computation
(cherry picked from commit f2c5f647cec786df26f442a85e6d685a131a50c9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevc: move restore_tqb where it should be.
(cherry picked from commit 8fafc96a9805d11bfe32537c8f78a294a5844065)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevc: use local variable for split_cu_flag
(cherry picked from commit ee71e9e9c12fc47856c452efb278f9f593a923ee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevc: separate residu and prediction (needed for Range Extension)
(cherry picked from commit 6b3856ef57d66f2e59ee61fd2eb5f83b6d0d7d4a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevc/rext: basic infrastructure for supporting range extension
- support for 4:2:2 and 4:4:4 up to 12 bits
- add a new profile for range extension
(cherry picked from commit d3c067fa65bbc871758d28aa07f54123430ca346)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevc/rext: add support for Range extension tools

SPS features/flags:
- transform_skip_rotation_enabled_flag
- transform_skip_context_enabled_flag
- implicit_rdpcm_enabled_flag
- explicit_rdpcm_enabled_flag
- intra_smoothing_disabled_flag
- persistent_rice_adaptation_enabled_flag

PPS features/flags:
- log2_max_transform_skip_block_size
- cross_component_prediction_enabled_flag
- chroma_qp_offset_list_enabled_flag
- diff_cu_chroma_qp_offset_depth
- chroma_qp_offset_list_len_minus1
- cb_qp_offset_list
- cr_qp_offset_list
- log2_sao_offset_scale_luma
- log2_sao_offset_scale_chroma
(cherry picked from commit 005294c5b939a23099871c6130c8a7cc331f73ee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/utils: add missing `@c man end` title

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg: Fix copying timebase to muxer context

Fixes Ticket3741

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mpegvideo_enc: return proper error instead of failing assertion when max rate is not set

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/options_table: add liberal limits to intra dc precission

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mpegvideo_enc: workaround applications specifying intra dc level based on 8 and othes based on 0bit

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mpegvideo_enc: check intra dc precission

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mpegvideo_enc: make edge for interlaced mpeg2 encoding smaller

Fixes segfault
the size can probably be reduced further for the mpeg2 case

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg_opt: remove intra_dc_precision, its handled by AVOptions

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
build: fix build with --disable-encoders

draw_edges() should probably be moved somewhere else to avoid
mpegvideo*enc* dependency to decoders.
avutil & avdevice: remove av_bprint_fd_contents()

MSVC does not allow passing file pointers between libs
This API can thus not work with MSVC and as it was very recently added
and its it was in no release its removial should not cause any problems

A better API will be implemented, but its not finished yet, this revert is
to avoid potentially blocking the release

Found-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/hevc_ps: prevent stale pointer in malloc failure case

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/hevc: treat current_sps like sps_list

This simplifies the management of current_sps
Fixes Ticket3458

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>