[FFmpeg-devel] [PATCH] [RFC] Second try at pixdesc.h:write_line()

Michael Niedermayer michaelni
Tue Apr 14 15:10:58 CEST 2009


On Tue, Apr 14, 2009 at 02:44:53PM +0200, Stefano Sabatini wrote:
> On date Tuesday 2009-04-14 13:28:33 +0200, Michael Niedermayer encoded:
> > On Tue, Apr 14, 2009 at 10:33:05AM +0200, Stefano Sabatini wrote:
> > > On date Tuesday 2009-04-14 04:21:51 +0200, Michael Niedermayer encoded:
> > > > On Tue, Apr 14, 2009 at 12:29:37AM +0200, Stefano Sabatini wrote:
> > > > > Hi all,
> > > > > 
> > > > > the attached patchset is an attempt at solving the bitstream
> > > > > randomization problem occurring when using skip_put_bits() and
> > > > > flush_put_bits().
> > > > > 
> > > > > Since the write_line() function has to keep intact the skipped
> > > > > content, I implemented the functions put_bits_save() and
> > > > > skip_put_bits_safe().
> > > > 
> > > > may i repeat my request to NOT use the bitstream writer for this
> > > 
> > > What do you suggest as alternative? The bitstream writer looks to me
> > > the natural choice.
> > 
> > the bitstream writer is a tool to write bits sequentially you arent doing
> > that.
> > What do i suggest as alternative? I suggest nothing, just write the code
> > we dont need to abstract from a single case
> > or change the way the code works so it does work sequentially, but that
> > may or may not be acceptable in terms of speed and prettiness
> 
> Sorry to ask again, but what's the problem with extending put_bits()
> to support safe skipping?

because it requires reading and merging of things from the buffer into
the internal state, it is not what the writer is designed for and it is
not efficient to hack it in there.


> 
> Alternatively I could couple a bitstream reader to the bitstream
> writer, read and set again the read bits when I need to skip them, but
> this won't be efficient.

ehm, no you wont do that in ffmpeg svn


> 
> The other alternative looks to me to rewrite from scratch a
> non-sequential bitstream writer, since it is indeed that that I need.

i would reject this too

in that light iam not even sure using the bitstream reader for the
pixel read function is such a good idea, i would probably prefer it
to be replaced ..

anyway as you seem to be confused:
for(){
    *buf |= *pixel++ << s;
    s-= C;
    buf -= s>>8;
    s&=7;
}

is one of many startpoints

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- 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/20090414/176c1928/attachment.pgp>



More information about the ffmpeg-devel mailing list