Commit Graph

83 Commits

Author SHA1 Message Date
Michael Niedermayer 8bedbb82ce j2k/jpeg2000: split data pointer in int & float.
This fixes a TODO item and unifies both decoders structures
It also fixes undefined behavior due to aliasing violations

I choose 2 fields instead of a union because mistakely using the
wrong type with a union will lead to hard to debug "wrong output"
while with 2 fields mistakely using the wrong type will crash
with a null pointer derefernce which is much easier to debug

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-30 14:18:53 +02:00
Michael Niedermayer ac025d6eca j2kdec: remove unused variables
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-29 19:57:03 +02:00
Michael Niedermayer 83fd377c94 j2k/jpeg2000: merge float DWT and related code
the float conditions are largely changed to check the DWT
instead of the bitexact flag, which previously was wrong
(DWT53 is always int)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-29 00:29:25 +02:00
Michael Niedermayer a510abd5d1 j2kdec:merge mct_decode from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-28 23:49:11 +02:00
Michael Niedermayer fe7136ef82 j2k/jpeg2000: split stepsize in float & int variables
This is more clear and less prone to mistakes.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-28 22:16:14 +02:00
Michael Niedermayer 32475f56f3 j2kdec/jpeg2000dec: partially merge quantization code
The quantization code needs more work, not so much work
merging but more work investigating what is correct.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-28 19:02:00 +02:00
Michael Niedermayer f0a2c8285a j2kdec: Try to fix 8bps output case
Ive no test samples for which this makes a difference but it
matches the 16bit implementation.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-28 18:58:46 +02:00
Michael Niedermayer 05fa3f6802 j2kdec: random non functional changed from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-28 01:46:59 +02:00
Michael Niedermayer d66de3801e j2kdec: merge get_tlm() from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-28 01:11:30 +02:00
Michael Niedermayer 8cf57efdd7 j2k/jpeg2000: merge lowres code
This also fixes lowres use with ffplay

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-28 00:30:06 +02:00
Michael Niedermayer d4a4661342 j2k/jpeg2000: merge j2k & jpeg2000 dwts, drop j2k dwt
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-27 21:54:07 +02:00
Michael Niedermayer 243cc38d94 j2k: change fixed point of stepsize to 16.16
This seems more natural and matches jpeg2000

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-27 17:58:06 +02:00
Michael Niedermayer 1b5cb6c00a j2k/jpeg2000: Partially merge quantization code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-27 17:50:54 +02:00
Michael Niedermayer 81ccc31f75 j2kdec: merge decode_tile cblk handling from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-27 15:13:18 +02:00
Michael Niedermayer 2c5a5c5a62 j2kdec: cdxy != 1 does not work, print an error
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-27 15:13:18 +02:00
Michael Niedermayer 369422db0c j2kdec: merge cblk restructuring from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-27 15:13:18 +02:00
Michael Niedermayer 53ec1c811e j2k: merge cosmetics and non functional changes from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-27 02:27:56 +02:00
Michael Niedermayer bd89b2b22a j2k/jpeg2000: log2_prec size cleanup
This also changes the cblk size storage method to what jpeg2000 uses

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 22:29:11 +02:00
Michael Niedermayer cb39dfb870 j2k/jpeg2000: check cblk size
This is based on j2k FCD which is ambigous thus the limit
might be tighter.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 20:15:50 +02:00
Michael Niedermayer 6e16321d66 j2kdec: add AVClass
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 20:15:50 +02:00
Michael Niedermayer df3e6e5e22 j2kdec: cosmetics from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 20:15:50 +02:00
Michael Niedermayer 277691a130 j2kdec: merge copyright header with jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 20:15:50 +02:00
Michael Niedermayer a2daf929ed j2kdec: profile code from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 20:15:50 +02:00
Michael Niedermayer 726eac1df9 j2kdec: cosmetics from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 20:15:50 +02:00
Michael Niedermayer 88d2dd00fe avcodec/j2kdec: drop disabled debug code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 20:15:50 +02:00
Michael Niedermayer de90bd6c3f j2k/jpeg2000: merge cosmetics and whitespace
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 20:15:50 +02:00
Michael Niedermayer bcf59b5d8f j2kdec: merge jpeg2000_init_static_data() from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 20:15:50 +02:00
Michael Niedermayer 5d67dfd71c j2kdec: move avctx init to decode_frame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 20:15:50 +02:00
Michael Niedermayer b4013899e2 j2k: s/ff_j2k_getsigctxno/ff_jpeg2000_getsigctxno/g
Also add a related comment

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 18:22:16 +02:00
Michael Niedermayer e66faf71eb j2k: merge ff_j2k_init_tier1_luts()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 18:07:48 +02:00
Michael Niedermayer 69b9773980 j2k: s/getnbctxno/getsigctxno/g
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 18:07:48 +02:00
Michael Niedermayer 5157ec89ef j2k: redesign vert_causal_ctx_csty implementation
The old implementation was incomplete and could not have worked
This also fixes some warnings
New code is untested as i dont seem to have a sample file that uses this.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 18:07:48 +02:00
Michael Niedermayer 438c45c08a j2kdec: fix used bytestream function
Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 15:00:23 +02:00
Michael Niedermayer d42106c3ac j2k: rename a few inline functions and data tables to match jpeg2000
also inlcudes some other cosmetics

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 14:02:44 +02:00
Michael Niedermayer c78f3e5571 j2kdec: prog_order reading from jpeg2000dec
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-26 13:57:56 +02:00
Michael Niedermayer 914ab4cd1c j2kdec & jpeg2000dec: check lengthinc against array size
Fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-22 04:18:38 +02:00
Michael Niedermayer 17e66c9ff4 j2k & jpeg2000dec: reset numX/Ytiles if tiles failed allocation
Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-22 03:18:55 +02:00
Michael Niedermayer f399b33c2b jpeg2000dec & j2kdec: Fix return type of get_sot()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-22 02:14:04 +02:00
Michael Niedermayer 8d9fa738f5 j2kdec: cosmetics from jpeg2000dec
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-22 01:25:52 +02:00
Michael Niedermayer 78c7bff04a avcodec/j2k: rename J2K_ constants to JPEG2000_
This should simplify merging the 2 decoders

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-21 21:44:34 +02:00
Michael Niedermayer 0ab0ed2b86 j2k: Rename structs to be more similar to jpeg2000dec
This should simplify merging

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-21 21:44:34 +02:00
Michael Niedermayer 376e89e280 j2kdec: s/decode_packets/jpeg2000_decode_packets/
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-21 21:44:34 +02:00
Michael Niedermayer d2bf8aecd3 j2kdec: frame multithreading support
This allows comparing the 2 decoders with threads

Based on:commit 2e2d24667a
By: Nicolas Bertrand <nicoinattendu@gmail.com>

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-06 16:38:03 +02:00
Michael Niedermayer c1c2b0b339 avcodec: rename jpeg2000 decoder to j2k
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-22 19:28:33 +02:00
Michael Niedermayer dc7ba0c1f4 j2kdec: remove unused variable and empty function
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-12 18:30:59 +01:00
Michael Niedermayer 80e9e63c94 Merge commit '759001c534287a96dc96d1e274665feb7059145d'
* commit '759001c534287a96dc96d1e274665feb7059145d':
  lavc decoders: work with refcounted frames.

Anton Khirnov (1):
      lavc decoders: work with refcounted frames.

Clément Bœsch (47):
      lavc/ansi: reset file
      lavc/ansi: re-do refcounted frame changes from Anton
      fraps: reset file
      lavc/fraps: switch to refcounted frames
      gifdec: reset file
      lavc/gifdec: switch to refcounted frames
      dsicinav: resolve conflicts
      smc: resolve conflicts
      zmbv: resolve conflicts
      rpza: resolve conflicts
      vble: resolve conflicts
      xxan: resolve conflicts
      targa: resolve conflicts
      vmnc: resolve conflicts
      utvideodec: resolve conflicts
      tscc: resolve conflicts
      ulti: resolve conflicts
      ffv1dec: resolve conflicts
      dnxhddec: resolve conflicts
      v210dec: resolve conflicts
      vp3: resolve conflicts
      vcr1: resolve conflicts
      v210x: resolve conflicts
      wavpack: resolve conflicts
      pngdec: fix compilation
      roqvideodec: resolve conflicts
      pictordec: resolve conflicts
      mdec: resolve conflicts
      tiertexseqv: resolve conflicts
      smacker: resolve conflicts
      vb: resolve conflicts
      vqavideo: resolve conflicts
      xl: resolve conflicts
      tmv: resolve conflicts
      vmdav: resolve conflicts
      truemotion1: resolve conflicts
      truemotion2: resolve conflicts
      lcldec: fix compilation
      libcelt_dec: fix compilation
      qdrw: fix compilation
      r210dec: fix compilation
      rl2: fix compilation
      wnv1: fix compilation
      yop: fix compilation
      tiff: resolve conflicts
      interplayvideo: fix compilation
      qpeg: resolve conflicts (FIXME/TESTME).

Hendrik Leppkes (33):
      012v: convert to refcounted frames
      8bps: fix compilation
      8svx: resolve conflicts
      4xm: resolve conflicts
      aasc: resolve conflicts
      bfi: fix compilation
      aura: fix compilation
      alsdec: resolve conflicts
      avrndec: convert to refcounted frames
      avuidec: convert to refcounted frames
      bintext: convert to refcounted frames
      cavsdec: resolve conflicts
      brender_pix: convert to refcounted frames
      cinepak: resolve conflicts
      cinepak: avoid using AVFrame struct directly in private context
      cljr: fix compilation
      cpia: convert to refcounted frames
      cscd: resolve conflicts
      iff: resolve conflicts and do proper conversion to refcounted frames
      4xm: fix reference frame handling
      cyuv: fix compilation
      dxa: fix compilation
      eacmv: fix compilation
      eamad: fix compilation
      eatgv: fix compilation
      escape124: remove unused variable.
      escape130: convert to refcounted frames
      evrcdec: convert to refcounted frames
      exr: convert to refcounted frames
      mvcdec: convert to refcounted frames
      paf: properly free the frame data on decode close
      sgirle: convert to refcounted frames
      lavfi/moviesrc: use refcounted frames

Michael Niedermayer (56):
      Merge commit '759001c534287a96dc96d1e274665feb7059145d'
      resolve conflicts in headers
      motion_est: resolve conflict
      mpeg4videodec: fix conflicts
      dpcm conflict fix
      dpx: fix conflicts
      indeo3: resolve confilcts
      kmvc: resolve conflicts
      kmvc: resolve conflicts
      h264: resolve conflicts
      utils: resolve conflicts
      rawdec: resolve conflcits
      mpegvideo: resolve conflicts
      svq1enc: resolve conflicts
      mpegvideo: dont clear data, fix assertion failure on fate vsynth1 with threads
      pthreads: resolve conflicts
      frame_thread_encoder: simple compilefix not yet tested
      snow: update to buffer refs
      crytsalhd: fix compile
      dirac: switch to new API
      sonic: update to new API
      svq1: resolve conflict, update to new API
      ffwavesynth: update to new buffer API
      g729: update to new API
      indeo5: fix compile
      j2kdec: update to new buffer API
      linopencore-amr: fix compile
      libvorbisdec: update to new API
      loco: fix compile
      paf: update to new API
      proresdec: update to new API
      vp56: update to new api / resolve conflicts
      xface: convert to refcounted frames
      xan: fix compile&fate
      v408: update to ref counted buffers
      v308: update to ref counted buffers
      yuv4dec: update to ref counted buffers
      y41p: update to ref counted frames
      xbm: update to refcounted frames
      targa_y216: update to refcounted buffers
      qpeg: fix fate/crash
      cdxl: fix fate
      tscc: fix reget buffer useage
      targa_y216dec: fix style
      msmpeg4: fix fate
      h264: ref_picture() copy fields that have been lost too
      update_frame_pool: use channel field
      h264: Put code that prevents deadlocks back
      mpegvideo: dont allow last == current
      wmalossless: fix buffer ref messup
      ff_alloc_picture: free tables in case of dimension mismatches
      h264: fix null pointer dereference and assertion failure
      frame_thread_encoder: update to bufrefs
      ec: fix used arrays
      snowdec: fix off by 1 error in dimensions check
      h264: disallow single unpaired fields as references of frames

Paul B Mahol (2):
      lavc/vima: convert to refcounted frames
      sanm: convert to refcounted frames

Conflicts:
	libavcodec/4xm.c
	libavcodec/8bps.c
	libavcodec/8svx.c
	libavcodec/aasc.c
	libavcodec/alsdec.c
	libavcodec/anm.c
	libavcodec/ansi.c
	libavcodec/avs.c
	libavcodec/bethsoftvideo.c
	libavcodec/bfi.c
	libavcodec/c93.c
	libavcodec/cavsdec.c
	libavcodec/cdgraphics.c
	libavcodec/cinepak.c
	libavcodec/cljr.c
	libavcodec/cscd.c
	libavcodec/dnxhddec.c
	libavcodec/dpcm.c
	libavcodec/dpx.c
	libavcodec/dsicinav.c
	libavcodec/dvdec.c
	libavcodec/dxa.c
	libavcodec/eacmv.c
	libavcodec/eamad.c
	libavcodec/eatgq.c
	libavcodec/eatgv.c
	libavcodec/eatqi.c
	libavcodec/error_resilience.c
	libavcodec/escape124.c
	libavcodec/ffv1.h
	libavcodec/ffv1dec.c
	libavcodec/flicvideo.c
	libavcodec/fraps.c
	libavcodec/frwu.c
	libavcodec/g723_1.c
	libavcodec/gifdec.c
	libavcodec/h264.c
	libavcodec/h264.h
	libavcodec/h264_direct.c
	libavcodec/h264_loopfilter.c
	libavcodec/h264_refs.c
	libavcodec/huffyuvdec.c
	libavcodec/idcinvideo.c
	libavcodec/iff.c
	libavcodec/indeo2.c
	libavcodec/indeo3.c
	libavcodec/internal.h
	libavcodec/interplayvideo.c
	libavcodec/ivi_common.c
	libavcodec/jvdec.c
	libavcodec/kgv1dec.c
	libavcodec/kmvc.c
	libavcodec/lagarith.c
	libavcodec/libopenjpegdec.c
	libavcodec/mdec.c
	libavcodec/mimic.c
	libavcodec/mjpegbdec.c
	libavcodec/mjpegdec.c
	libavcodec/mmvideo.c
	libavcodec/motion_est.c
	libavcodec/motionpixels.c
	libavcodec/mpc7.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo.h
	libavcodec/msrle.c
	libavcodec/msvideo1.c
	libavcodec/nuv.c
	libavcodec/options_table.h
	libavcodec/pcx.c
	libavcodec/pictordec.c
	libavcodec/pngdec.c
	libavcodec/pnmdec.c
	libavcodec/pthread.c
	libavcodec/qpeg.c
	libavcodec/qtrle.c
	libavcodec/r210dec.c
	libavcodec/rawdec.c
	libavcodec/roqvideodec.c
	libavcodec/rpza.c
	libavcodec/smacker.c
	libavcodec/smc.c
	libavcodec/svq1dec.c
	libavcodec/svq1enc.c
	libavcodec/targa.c
	libavcodec/tiertexseqv.c
	libavcodec/tiff.c
	libavcodec/tmv.c
	libavcodec/truemotion1.c
	libavcodec/truemotion2.c
	libavcodec/tscc.c
	libavcodec/ulti.c
	libavcodec/utils.c
	libavcodec/utvideodec.c
	libavcodec/v210dec.c
	libavcodec/v210x.c
	libavcodec/vb.c
	libavcodec/vble.c
	libavcodec/vcr1.c
	libavcodec/vmdav.c
	libavcodec/vmnc.c
	libavcodec/vp3.c
	libavcodec/vp56.c
	libavcodec/vp56.h
	libavcodec/vp6.c
	libavcodec/vqavideo.c
	libavcodec/wavpack.c
	libavcodec/xl.c
	libavcodec/xxan.c
	libavcodec/zmbv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-12 03:23:28 +01:00
Paul B Mahol 4012cd6c4f lavc: fix decode_frame() third parameter semantics for rest of video decoders
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-12-05 18:24:43 +00:00
Michael Niedermayer 874c5b02c4 Merge commit '594d4d5df3c70404168701dd5c90b7e6e5587793'
* commit '594d4d5df3c70404168701dd5c90b7e6e5587793':
  lavc: add a wrapper for AVCodecContext.get_buffer().

Conflicts:
	libavcodec/4xm.c
	libavcodec/8svx.c
	libavcodec/bmv.c
	libavcodec/cljr.c
	libavcodec/cscd.c
	libavcodec/dnxhddec.c
	libavcodec/dpcm.c
	libavcodec/dpx.c
	libavcodec/eacmv.c
	libavcodec/eamad.c
	libavcodec/frwu.c
	libavcodec/g723_1.c
	libavcodec/gifdec.c
	libavcodec/idcinvideo.c
	libavcodec/iff.c
	libavcodec/indeo3.c
	libavcodec/internal.h
	libavcodec/interplayvideo.c
	libavcodec/kmvc.c
	libavcodec/mpc7.c
	libavcodec/mpegaudiodec.c
	libavcodec/pcx.c
	libavcodec/pngdec.c
	libavcodec/pnmdec.c
	libavcodec/rl2.c
	libavcodec/snow.c
	libavcodec/targa.c
	libavcodec/tscc.c
	libavcodec/txd.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/vb.c
	libavcodec/vmdav.c
	libavcodec/vp56.c
	libavcodec/vqavideo.c
	libavcodec/wavpack.c
	libavcodec/wnv1.c
	libavcodec/xl.c
	libavcodec/yop.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-05 15:18:12 +01:00
Michael Niedermayer bc077ca6b5 j2kdec: remove unneeded operation
Fixes CID717554
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-14 22:16:31 +02:00
Michael Niedermayer 1e6cbb01e9 j2kdec: make curtilenum integer.
This fixes a potential crash.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-14 22:16:31 +02:00