[Ffmpeg-devel] libavcodec h264 decoder
michael benzon chua
Fri Dec 15 10:29:04 CET 2006
On 12/15/06, Stefan Gehrer <stefan.gehrer at gmx.de> wrote:
> michael benzon chua wrote:
> > On 12/14/06, Stefan Gehrer <stefan.gehrer at gmx.de> wrote:
> >> michael benzon chua wrote:
> >> > apologies if this post isn't in any particular format, i couldn't
> >> > anything on the mailing list page about following a specific
> >> >
> >> > can someone point me to where libavcodec decodes h.264 macroblocks?
> >> > trying to access the dct coefficients of i type 4x4 luma blocks.
> >> In h264.c, functions decode_mb_cavlc and decode_mb_cabac.
> > Is this the case even if I turned off cabac? I usually generate my .264
> > bitstreams with the no-cabac option turned on for the x264.
> decode_mb_cabac if cabac is on, decode_mb_cavlc otherwise.
Thank you. I'll try and fiddle with the function and see how it turns out.
> >> >
> >> > essentially, i modified the x264 encoder to flip the sign of the
> >> top-left
> >> > most coefficient in the dct block during macroblock encoding, and i
> >> > want to
> >> > try and reverse the process during decoding. i just added this line
> >> > code
> >> > in x264's encoder/macroblock.c, under the x264_mb_encode_i4x4
> >> function:
> >> >
> >> > dct4x4 = 0 - dct4x4;
> >> >
> >> > right after quantization and scanning, but before dequantization...
> >> >
> >> What are you trying to achieve with that?
> > My end goal is to encrypt the upper triangle of the dct block during
> > encoding, and decrypt it during decoding using any cryptosystem. I'm
> > taking
> > small steps. The first thing I'm trying to do is simply to modify 1 dct
> > block value during encoding, and to reverse what I did during
> > decoding. In
> > the case above, I flipped the sign of the dct coefficient during
> > encoding.
> > This has a visible effect on the video (it looks blotchier). I want to
> > able to change the sign back during the decoding process, so that the
> > video
> > looks as it would have if I'd never modified the dct coefficient at all.
> Interesting concept, but as soon as you use some real cryptography instead
> of just toggling the sign I think the bitstream size will increase as some
> seemingly random coefficients will be harder to compress than what the
> encoder outputs. Or am I missing something?
I think this is the case as well. The size of the output .264 file increased
when I changed the dct values. I'm hoping the effect isn't too significant,
and that the encryption is still reversible.
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
More information about the ffmpeg-devel