From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH v3 2/2] libavcodec/flacenc: Implement encoding of 32 bit-per-sample PCM Date: Fri, 2 Sep 2022 21:04:51 +0200 Message-ID: <AS8P250MB074492E3E088310B5CECF6978F7A9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <CADQbU689s90XMDh-PjZKjbkNYcyW1KhRxMQUZtTNPQ8JK5q3vg@mail.gmail.com> Martijn van Beurden: > First of all, thanks for reviewing. > > Op vr 2 sep. 2022 om 17:11 schreef Andreas Rheinhardt < > andreas.rheinhardt@outlook.com>: > >>> +static inline void put_sbits64(PutBitContext *pb, int n, int64_t value) >>> +{ >>> + av_assert2(n >= 0 && n <= 64); >>> + >>> + put_bits64(pb, n, (uint64_t)(value) & (~(UINT64_MAX << n))); >> >> Shifting by 64 bits here is UB, so better modify the assert to disallow >> it. And rename the function to put_sbits63(). >> >> > I could also add specific handling for the 64-bit case. Perhaps something > like > > put_bits64(pb, n, (uint64_t)(value) & (~((n < 64)?(UINT64_MAX << n):0))); > > or should I leave that to whoever needs that functionality? > Leave it to whoever needs this. > >>> -static inline void set_sr_golomb_flac(PutBitContext *pb, int i, int k, >>> - int limit, int esc_len) >>> +static inline void set_sr_golomb_flac(PutBitContext *pb, int i, int k) >> >> This seems to be only used by flacenc.c, so IMO it would be better to >> move it there. >> >> > Yes, I was wondering what to do with this, similarly with the functions in > get_bits, mathops and put_bits. I suppose the additions to get_bits, > mathops and put_bits might be useful to others in the future. The golomb > code is probably not useful for other codecs indeed. Is that reasoning > valid? Yes. _______________________________________________ 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".
prev parent reply other threads:[~2022-09-02 19:05 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-02 14:20 [FFmpeg-devel] [PATCH v3 0/2] 32bps FLAC patches Martijn van Beurden 2022-09-02 14:20 ` [FFmpeg-devel] [PATCH v3 1/2] libavcodec/flacdec: Implement decoding of 32 bit-per-sample PCM Martijn van Beurden 2022-09-02 14:20 ` [FFmpeg-devel] [PATCH v3 2/2] libavcodec/flacenc: Implement encoding " Martijn van Beurden 2022-09-02 15:10 ` Andreas Rheinhardt 2022-09-02 18:43 ` Martijn van Beurden 2022-09-02 19:04 ` Andreas Rheinhardt [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=AS8P250MB074492E3E088310B5CECF6978F7A9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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