[FFmpeg-devel] [PATCH] H.264: Record slice_qs_delta syntax element
Michael Niedermayer
michaelni
Sun Dec 20 16:52:38 CET 2009
On Sun, Dec 20, 2009 at 04:30:55PM +0100, Gwenole Beauchesne wrote:
> Hi,
>
> On Sat, 12 Dec 2009, Michael Niedermayer wrote:
>
>> On Fri, Dec 11, 2009 at 03:25:34PM +0100, Gwenole Beauchesne wrote:
>>> Hi,
>>>
>>> slice_qp_delta and slice_qs_delta values from the bitstream are
>>> respectively needed for VAAPI,DXVA and DXVA.
>>
>>> The former could be
>>> reconstructed with a single subtraction though.
>>
>> then i would suggest to do it with a subtraction
>
> This is what we currently do but I felt having both recorded was better for
> consistency. qscale doesn't seem to be altered elsewhere for h264, so
> keeping the subtraction is ok for slice_qp_delta.
>
> Anyway, here is a new patch with only slice_qs_delta.
>
> Thanks,
> Gwenole.
> h264.c | 2 +-
> h264.h | 2 ++
> 2 files changed, 3 insertions(+), 1 deletion(-)
> 967b28be582c7ea93b8d2dff7953c90a58c8e63e ffmpeg.h264.record.slice_qs_delta.patch
> commit 30cb151105ea749f3851308698ec501012bdf3e2
> Author: Gwenole Beauchesne <gbeauchesne at splitted-desktop.com>
> Date: Fri Dec 11 13:51:15 2009 +0000
>
> Record slice_qs_delta syntax element.
>
> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index 1bfb1e2..e98ff0a 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -4061,7 +4062,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
> get_bits1(&s->gb); /* sp_for_switch_flag */
> }
> if(h->slice_type==FF_SP_TYPE || h->slice_type == FF_SI_TYPE){
> - get_se_golomb(&s->gb); /* slice_qs_delta */
> + h->slice_qs_delta = get_se_golomb(&s->gb); /* slice_qs_delta */
> }
>
> h->deblocking_filter = 1;
> diff --git a/libavcodec/h264.h b/libavcodec/h264.h
> index fa348a2..f624bc3 100644
> --- a/libavcodec/h264.h
> +++ b/libavcodec/h264.h
> @@ -545,6 +545,8 @@ typedef struct H264Context{
> // Timestamp stuff
> int sei_buffering_period_present; ///< Buffering period SEI flag
> int initial_cpb_removal_delay[32]; ///< Initial timestamps for CPBs
> +
> + int slice_qs_delta; ///< Initial value of QSy
slice_qs_delta is not the initial value of QSy
did you test this code?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091220/02d29805/attachment.pgp>
More information about the ffmpeg-devel
mailing list