Граф коммитов

81 Коммитов

Автор SHA1 Сообщение Дата
Yaowu Xu 4fcf726a0e Return error on wrong sync code
Not initialize codec stream info

This fixes vp8 fuzzing issue reported at build #56

Change-Id: I307ac839b4f4bda3a02a551019c0d688dba19c86
2015-01-05 17:19:32 -08:00
Johann 80b344dec5 Silence -Werror=unused-parameter
Cast away remaining issues so that new ones don't get lost in the noise.

Change-Id: Iacd6999b0686ce80f9835730d68db6382690fa92
2014-12-16 12:47:08 -08:00
hkuang 9353607ac8 Fix a bug that break the vp8 fragment decoder.
(issue #882).

Change-Id: I2ca7f96d390c4eaec0473c50cb01b903d0bd3ee6
2014-12-12 16:44:14 -08:00
Deb Mukherjee a349ee3bf5 Resolves some lint errors
And also fixes some style consistency issues.

Change-Id: I3dc6d44e17d2d6075dc9b02c4255a7395046c5e0
2014-10-13 16:05:44 -07:00
Dmitry Kovalev 91998e638e Removing sz member from vpx_codec_priv.
Change-Id: I811526a9ee9f237604f72abe7fc677e39e0f457f
2014-09-04 14:47:42 -07:00
Dmitry Kovalev b08fab8808 Consistent allocation of vpx_codec_alg_priv_t.
Change-Id: I5a03496de035fbcf31e4527cd25fcae4627a57a0
2014-09-03 11:01:21 -07:00
Dmitry Kovalev 73edeb03ea Removing alg_priv from vpx_codec_priv struct.
In order to understand memory layout consider the declaration of the
following structs. The first one is a part of our API:

struct vpx_codec_ctx {
  // ...
  struct vpx_codec_priv *priv;
};

The second one is defined in vpx_codec_internal.h:

struct vpx_codec_priv {
  // ...
};

The following struct is defined 4 times for encoder/decoder VP8/VP9:

struct vpx_codec_alg_priv {
  struct vpx_codec_priv base;
  // ... 
};

Private data allocation for the given ctx:

struct vpx_codec_ctx *ctx = <get>
struct vpx_codec_alg_priv *alg_priv = <allocate>
ctx->priv = (struct vpx_codec_priv *)alg_priv;

The cast works because vpx_codec_alg_priv has a
vpx_codec_priv instance as a first member 'base'.

Change-Id: I10d1afc8c9a7dfda50baade8c7b0296678bdb0d0
2014-08-28 13:51:37 -07:00
Dmitry Kovalev eafa7126a0 Merge "Replacing NOT_IMPLMENTED with NULL." 2014-08-21 11:10:00 -07:00
Dmitry Kovalev cd6d9846b0 Replacing NOT_IMPLMENTED with NULL.
We don’t need to introduce new macro for the null value.

Change-Id: I59dbae25feeebb4e8359095801aecc8bb17d7764
2014-08-20 17:16:28 -07:00
Dmitry Kovalev f2e652396f Removing iface pointer from vpx_codec_priv.
The iface pointer is already in vpx_codec_ctx struct.

Change-Id: I9fffe27c613a7c94476f185a1e5a53ff6d99f1c6
2014-08-20 12:31:19 -07:00
Johann 69dc876b4e Set uv_crop_height/width in all the places
When configuring the buffer make sure to set all the (now) required
fields. Use the canonical variables and match the style from vpx_scale.

https://code.google.com/p/webm/issues/detail?id=841

Change-Id: I71b43d4a03756b8b2d6d60fdf8d7bf41b8041787
2014-08-15 14:55:21 -07:00
James Zern 7d9da93a97 VP8D_GET_FRAME_CORRUPTED: check frame pointer
if the decode of the first frame fails, frame_to_show may not be set.
fixes a crash in vpxdec with corrupt data.

Change-Id: I5ab9476d005778a13fd42a39d05876bb6c90a93c
2014-08-12 17:41:47 -07:00
Dmitry Kovalev 9a4cd41793 Merge "Removing legacy XMA features from libvpx." 2014-08-08 14:58:23 -07:00
Hangyu Kuang 7050074756 Make the api behavior conform to api spec.
When no more data is available, vpx_codec_decode should
be called with NULL as data and 0 as data_sz.

vpx_codec_get_frame iterates over a list of the frames
available for display. The iterator storage should be initialized
to NULL to start the iteration. Iteration is complete when this
function returns NULL.

Also change the unit test to conform to the api spec.

Change-Id: I4b258b309f5df3d37d10c82f01492c0394181c2a
2014-08-06 11:16:14 -07:00
Dmitry Kovalev a42b5c2ffc Removing legacy XMA features from libvpx.
Change-Id: I60ffee7cf78e748792fa6d109322ec32f92e40a9
2014-08-05 16:34:09 -07:00
Jim Bankoski 8a774e14ff Changes interface to avoid uninitialized warnings in vp9_cx_iface.c.
Change-Id: I1092239e21c1cde188ee2dcb765f4c6fc8c5cdec
2014-07-31 06:27:57 -07:00
Deb Mukherjee 449e5f2aba Misc. bit-depth related changes
Sets the bit-depth field as default 8 in the image structure in vp8.
Generalizes yuv read in preparation for support for reading 422/444
for 8-bit and 10/12-bit.

Change-Id: I560c13c348b122fd028e408431156376b895058c
2014-07-14 11:48:04 -07:00
James Zern 61c3338516 call vp[89]_clear_system_state after longjmp
restore the environment post encode/decode failure

Change-Id: I3c72e2260a616432eaf1f9545d4fb4d8e45cc7b0
2014-07-10 12:36:28 -07:00
Dmitry Kovalev 8a8b662eaa Removing ctrl_id parameter from vpx_codec_control_fn_t.
Change-Id: I2b61c8c17ded1074dea92b4f6ad9be84d128b52a
2014-05-27 16:45:58 -07:00
Deb Mukherjee caba78ef49 Fixes a bug for uninitialized frame buffers
Fixes a bug introduced in
https://gerrit.chromium.org/gerrit/#/c/69779/13, where
uninitialized frame buffers due to corrupt and short
buffer sizes, may cause a crash.

This patch fixes the currently failing
video/processing/static_image/vp8_convert_test

Change-Id: I1b09e21482f292c11a2bfb4e570aef1d643410a7
2014-05-23 01:26:01 -07:00
Joey Parrish 18c08607e0 Add VPXD_SET_DECRYPTOR support to the VP9 decoder.
Change-Id: I88f86c8ff9af34e0b6531028b691921b54c2fc48
2014-04-23 16:11:54 -07:00
Dmitry Kovalev 8503d72e6a Removing legacy XMA code from vp8.
Change-Id: Ib9f7fd3fd56e304e5f587f790c97ac34a3077265
2014-04-10 23:30:17 -07:00
Frank Galligan a4f30a5023 Add VP9 decoder support for external frame buffers
Added support for external frame buffers to libvpx's VP9 decoder.
If the external frame buffer functions are set then libvpx will
call the get function whenever it needs a new frame buffer to
decode a frame into. And it will call the release function
whenever there are no more references to that buffer.

Change-Id: Id2934d005f606af6e052fb6db0d5b7c02f567522
2014-02-13 13:14:19 -08:00
Frank Galligan b1c72b633e Revert external frame buffer code.
A future CL will add external frame buffers
differently.

Squash commit of four revert commits:
Revert "Increase required number of external frame buffers"

This reverts commit 9e41d569d7.

Revert "Add external constants."

This reverts commit bbf53047b0.

Revert "Add frame buffer lru cache."

This reverts commit fbada948fa.

Conflicts:
	vpxdec.c

Change-Id: I76fe42419923a6ea6c75d9997cbbf941d73d3005

Revert "Add support to pass in external frame buffers."

This reverts commit 10f891696b.

Conflicts:
	test/external_frame_buffer_test.cc
	vp9/common/vp9_alloccommon.c
	vp9/common/vp9_reconinter.c
	vp9/decoder/vp9_decodeframe.c
	vp9/encoder/vp9_onyx_if.c
	vp9/vp9_dx_iface.c
	vpx/vpx_decoder.h
	vpx/vpx_external_frame_buffer.h
	vpx_scale/generic/yv12config.c
	vpxdec.c

Change-Id: I7434cf590f1c852b38569980e4247fad0d939c2e
2014-01-24 10:10:20 -08:00
Frank Galligan 10f891696b Add support to pass in external frame buffers.
VP9 decoder can now use frame buffers passed in by the application.

Change-Id: I599527ec85c577f3f5552831d79a693884fafb73
2013-12-15 18:45:46 -08:00
James Zern 4fc6c88e9c yv12config: remove YUV_TYPE
this was never fleshed out in the context of VP8, for which it was
added. for VP9 it has no meaning.

Change-Id: Iba2ecc026d9e947067b96690245d337e51e26eff
2013-07-12 15:25:48 -07:00
James Zern e202a2be03 vp[89]_dx_iface: delete unused function
static mmap_lkup

Change-Id: I24aeac1eca8453e28d58bc06925e58efc228a0a6
2013-07-11 23:03:24 -07:00
James Zern b088998e5d vp[89]_dx_iface: factorize vp8_mmap_*()
s/vp8/vpx/ -> vpx_codec_internal.h / vpx_codec.c

Change-Id: If4192b40206276a761b01d44e334fe15bcb81128
2013-07-11 23:01:26 -07:00
Jeff Petkau 368c72374e Change the encryption feature to use a callback for decryption.
This allows code calling the library can choose an arbitrary
encryption algorithm.

Decoder control parameter VP8_SET_DECRYPT_KEY is renamed to
VP8D_SET_DECRYPTOR, and now takes an small config struct instead
of just a byte array.

Change-Id: I0462b3388d8d45057e4f79a6b6777fe713dc546e
2013-06-17 11:32:16 -07:00
Scott LaVarnway c3ae212e80 Modified vpxdec loop
to work like vpxenc.  This is required for the frame-based
multithreading.


Change-Id: I338ae9c7d52b0541f3536cc033d6b89f00866e74
2013-06-07 12:39:03 -04:00
John Koleszar 7f7d1357a2 Merge branch 'experimental' into master
VP9 preview bitstream 2, commit '868ecb55a1528ca3f19286e7d1551572bf89b642'

Conflicts:
	vp9/vp9_common.mk

Change-Id: I3f0f6e692c987ff24f98ceafbb86cb9cf64ad8d3
2013-04-16 06:49:46 -07:00
Dmitry Kovalev 26cec5c13f Basic encryption feature for libvpx.
New decoder control paramter VP8_SET_DECRYPT_KEY to set the decryption key.

Change-Id: I6fc1f44d41f74f3b3f702778af1a6f8f5cc9439f
2013-03-15 18:21:55 -07:00
James Zern 798c5b148d vp8_init: fix NULL dereference on allocation error
Change-Id: I15a6cd014fce8090cdb0441723bd1a90b562579c
2013-03-02 14:46:06 -08:00
Scott LaVarnway 75f647fe8a WIP: Multiple decoder instances support
Started adding support for multiple internal decoder instances.  Also added
code to limit the vp8 config options available when using frame-based
multithreading.

Change-Id: I0f1ee7abcfcff59204f50162e28254b8dd6972eb
2013-01-30 10:27:26 -08:00
Scott LaVarnway 2146c68dfd Use FRAGMENT_DATA struct in pbi
for fragment information.

Change-Id: Idc83625591a1e4ca6f551dcfb7fc0428f6f37351
2013-01-29 10:34:35 -08:00
Marco Paniconi c582617b13 Merge "Bug fix: Handle input data ptr = NULL and size = 0 correctly" 2013-01-25 12:05:13 -08:00
Scott LaVarnway d6a4a5d98f Bug fix: Handle input data ptr = NULL and size = 0 correctly
Issue 517:	Issues decoding VPX_CODEC_USE_INPUT_FRAGMENTS
http://code.google.com/p/webm/issues/detail?id=517

Change-Id: I030c4cf15b1e1b993433571b6ee77c959a368ff2
2013-01-22 10:52:29 -08:00
John Koleszar a9c7597adc support building vp8 and vp9 into a single lib
Change-Id: Ib8f8a66c9fd31e508cdc9caa662192f38433aa3d
2012-11-15 10:46:17 -08:00
Scott LaVarnway f4316f39a1 Move frame allocations out of vp8_decode_frame()
in order to make it easier to implement the frame-base multithreading.

Change-Id: Iea2fd05be34fa704848fdc7669bf167f2ed229c5
2012-09-24 12:44:45 -07:00
Scott LaVarnway e278673c8e Moved vp8dx_get_raw_frame() call to vp8_get_frame()
This change is necessary for the frame-based multithreading
implementation.
Since the postproc occurs in this call, vpxdec was modified to time around
vpx_codec_get_frame()

Change-Id: I389acf78b6003cd35e41becc16c893f7d3028523
2012-09-19 12:30:44 -07:00
John Koleszar 8df79e9d42 Remove threading dependencies with --disable-multithread
Avoid a pthreads dependency via pthread_once() when compiled with
--disable-multithread.

In addition, this synchronization is disabled for Win32 as well, even
though we can be sure that the required primatives exist, so that the
requirements on the application when built with --disable-multithread
are consistent across platforms.

Users using libvpx built with --disable-multithread in a multithreaded
context should provide their own synchronization. Updated the
documentation to vpx_codec_enc_init_ver() and vpx_codec_dec_init_ver()
to note this requirement. Moved the RTCD initialization call to match
this description, as previously it didn't happen until the first
frame.

Change-Id: Id576f6bce2758362188278d3085051c218a56d4a
2012-06-15 16:26:39 -07:00
John Koleszar 2bf8fb5889 remove deprecated pre-v0.9.0 API
Remove a bunch of compatibility code dating back to before the initial
libvpx release.

Change-Id: Ie50b81e7d665955bec3d692cd6521c9583e85ca3
2012-05-04 10:44:46 -07:00
Attila Nagy f039a85fd8 Make global data const
Removes all runtime initialization of global data. This commit is a
squashed version of the following series cherry-picked from master.
This is necessary because of a change that was merged to the tester
that depends on the scaler being moved to the RTCD framework, which
is a worthwhile thing to include in Eider anyway.

  - a91b42f02 Makes all global data in entropy.c const
  - b35a0db0e Makes all global data in tokenize.c const
  - 441cac8ea Makes all mode token tables const
  - 5948a0210 Ports vpx_xcaler to new RTCD method
  - 317d4244c Makes all mode token tables const part 2

Change-Id: Ifeaea24df2b731e7c509fa6c6ef6891a374afc26
2012-05-04 10:42:21 -07:00
John Koleszar 8be41bba80 Hook up VP8D_GET_LAST_REF_USED
Commit 892e23a5b introduced support for the VP8D_GET_LAST_REF_USED,
but missed the mapping of the control id to the underlying function,
so it was unavailable to applications.

In addition, the underlying function vp8_references_buffer() is
moved from common/postproc.c to decoder/onyxd_if.c as postproc.c is
not built in all configurations.

Change-Id: I426dd254e7e6c4c061b70d729b69a6c384ebbe44
2012-01-27 10:13:20 -08:00
Jim Bankoski 892e23a5ba vp8d - function to check if a reference frame is used.
Change-Id: Id683b4d7f46ffa99145fc4b824c7232ab4182f21
2012-01-10 10:10:26 -08:00
Deb Mukherjee 28aa08748e Merge "Multiframe quality enhancement postprocessing" 2012-01-09 10:23:24 -08:00
Deb Mukherjee 87aa846b47 Multiframe quality enhancement postprocessing
Adds a multiframe postprocessing module to enhance the quality of
certain frames that are coded at lower quality than preceding frames.
The module can be invoked from the commandline by use of the --mfqe
option, and will be most beneficial for enhancing the quality of
frames decoded using scalable patterns.

Uses the vp8_variance_var16x16 and vp8_variance_sad16x16 function
pointers to compute SAD and Variance of blocks.

Change-Id: Id73d2a6e3572d07f9f8e36bbce00a4fc5ffd8961
2012-01-05 10:21:48 -08:00
John Koleszar bf1a8073c3 Remove opaque pointer VP8D_PTR
Use an opaque struct rather than typecasting through VP8D_PTR, an int*.

Change-Id: Ia260b7d53d7e0950cfa1e00f4ecead1099bd3b87
2011-12-21 14:48:10 -08:00
Yunqing Wang aa7335e610 Multiple-resolution encoder
The example encoder down-samples the input video frames a number of
times with a down-sampling factor, and then encodes and outputs
bitstreams with different resolutions.

Support arbitrary down-sampling factor, and down-sampling factor
can be different for each encoding level.

For example, the encoder can be tested as follows.
1. Configure with multi-resolution encoding enabled:
../libvpx/configure --target=x86-linux-gcc --disable-codecs
--enable-vp8 --enable-runtime_cpu_detect --enable-debug
--disable-install-docs --enable-error-concealment
--enable-multi-res-encoding
2. Run make
3. Encode:
If input video is 1280x720, run:
./vp8_multi_resolution_encoder 1280 720 input.yuv 1.ivf 2.ivf 3.ivf 1
(output: 1.ivf(1280x720); 2.ivf(640x360); 3.ivf(320x180).
The last parameter is set to 1/0 to show/not show PSNR.)
4. Decode:
./simple_decoder 1.ivf 1.yuv
./simple_decoder 2.ivf 2.yuv
./simple_decoder 3.ivf 3.yuv
5. View video:
mplayer 1.yuv -demuxer rawvideo -rawvideo w=1280:h=720 -loop 0 -fps 30
mplayer 2.yuv -demuxer rawvideo -rawvideo w=640:h=360 -loop 0 -fps 30
mplayer 3.yuv -demuxer rawvideo -rawvideo w=320:h=180 -loop 0 -fps 30

The encoding parameters can be modified in vp8_multi_resolution_encoder.c,
for example, target bitrate, frame rate...

Modified API. John helped a lot with that. Thanks!

Change-Id: I03be9a51167eddf94399f92d269599fb3f3d54f5
2011-12-05 17:59:42 -05:00
Stefan Holmer 1427205215 Changing decoder input partition API to input fragments.
Adding support for several partitions within one input fragment.
This is necessary to fully support all possible packetization
combinations in the VP8 RTP profile. Several partitions can
be transmitted in the same packet, and they can only be split
by reading the partition lengths from the bitstream.

Change-Id: If7d7ea331cc78cb7efd74c4a976b720c9a655463
2011-11-01 14:44:37 -07:00