Commit Graph

340 Commits

Author SHA1 Message Date
Vlad Tsyrklevich
bc29863b96 [CFI] Remove function pointer casts
Control Flow Integrity [1] indirect call checking verifies that function
pointers only call valid functions with a matching type signature. This
change eliminates function pointer casts to make libvpx CFI-safe.

[1] https://www.chromium.org/developers/testing/control-flow-integrity

Change-Id: I7e08522d195a43c88cda06fa20414426c8c4372c
2017-11-20 16:36:29 -08:00
Jerome Jiang
6246d8aa76 vp9: Fix mem rel for non-ref for external buffer.
Release frame buffers for non-ref when the decoder is destroyed.

Enable the non ref test.

BUG=b/68819248

Change-Id: Id87ef3b0a62318f9812e927cd957c05c859047fa
2017-11-09 15:47:21 -08:00
James Zern
48c4a038eb vp9: remove (un)lock_buffer_pool
there is no threaded access to this pool after the removal of
frame_parallel_decode

BUG=webm:1395

Change-Id: I710769b87102edc898c59eb9a2e7a91d8c49107f
2017-07-05 21:07:00 -07:00
James Zern
ba76b662af VP9Decoder: rm frame_parallel_decode
this has been 0 since the removal of frame_parallel_decode in
vp9_dx_iface.

BUG=webm:1395

Change-Id: I3f579766ecfa4777395b99686738e1c5610f86ef
2017-06-30 12:03:07 -07:00
Linfeng Zhang
d5de63d2be Update highbd idct functions arguments to use uint16_t dst
BUG=webm:1388

Change-Id: I3581d80d0389b99166e70987d38aba2db6c469d5
2017-05-03 13:59:16 -07:00
Linfeng Zhang
081b39f2b7 Clean CONVERT_TO_BYTEPTR/SHORTPTR in idct
BUG=webm:1388

Change-Id: Ida62c941f2b836d6c9e27b427a7d5008ab6dc112
2017-05-03 13:58:31 -07:00
Linfeng Zhang
4758d20227 Clean vp9_highbd_build_inter_predictor() and highbd_inter_predictor()
BUG=webm:1388

Change-Id: I7ee32e0c08f0fb41712a8cc640b2c5bba872421d
2017-04-25 14:32:20 -07:00
clang-format
4b402746ca apply clang-format
Change-Id: I75e4a9e0b37bd4586f26c8d6c1fa27f3f6ff1bce
2017-02-14 12:45:52 -08:00
James Zern
1961a92a94 vp9,tile_worker_hook: correctly set jmp target
vp9_init_macroblockd() resets the error_info to cm's global copy; this
needs to be set to the thread-level target to avoid jumping to the
incorrect stack, resulting in hang or crash.
broken since:
1f4a6c8 vp9/tile_worker_hook: add multiple tile decoding
includes v1.5.0, v1.6.0

BUG=629481

Change-Id: Icbf1696b25ba8c479e845fbf227b3c3ca73542f5
2016-11-01 18:45:50 -07:00
Scott LaVarnway
7a34f85955 VP9: pass TileWorkerData instead of MACROBLOCKD and vpx_reader.
Change-Id: I869ef0f113c022143b531c44aefa0f1bb267052d
2016-09-22 13:18:36 -07:00
Debargha Mukherjee
e6446b4b60 Refactor uv tx size with lookup arrays
Change-Id: Ife6a3d301c5faaba89d16d188d638631083511f7
2016-08-31 13:15:38 -07:00
clang-format
08131055e4 vp9/decoder,vp9/*.[hc]: apply clang-format
Change-Id: Ic38ea06c7b2fb3e8e94a4c0910e82672a1acaea7
2016-08-03 14:29:31 -07:00
Debargha Mukherjee
4b6e4e1813 Remove decode asserts from better-hw-compatibility
Safer to have the decoder operate normally and have
better-hw-compatibility only implement encoding changes.
Fixes some test failures.

Change-Id: I0dd70d002e4e893992f0cd59774b9363e6f7fe76
2016-07-06 12:26:38 -07:00
Yaowu Xu
75b6cfe1c5 Prevent read to invalid RefBuffer
This commit adds check to validate RefBuffer before reading into the
data structure, to prevent invalid read.

BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=614701

Change-Id: Ie111e95bd18e88fa19d8b25e097cdf52b7139cb6
2016-05-25 09:28:36 -07:00
Yaowu Xu
489f8b2d88 Merge "Prevent invalid read" 2016-05-18 23:54:56 +00:00
Alex Converse
a5191f3e60 Move, rename, and inline high_inter_predictor.
The inlining mirrors what was done with the low bit depth
inter_predictor. And the new highbd_inter_predictor name is more
consistent with other high bit depth functions.

Change-Id: I96437f745759aeec6260c6e39a974bf36f1c211c
2016-05-18 09:39:49 -07:00
Yaowu Xu
4f0e4d6cef Prevent invalid read
This commit adds a check before reading into RefBuffer to prevent OOB
read.

BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=612023

Change-Id: I5b02951932e7f457cfbe6b2e650790496b8577ae
2016-05-18 07:40:49 -07:00
Scott LaVarnway
ad47d1d194 Merge "VP9: Combine TileData with TileWorkerData" 2016-04-10 22:17:45 +00:00
Scott LaVarnway
7cb4ab56ea VP9: Combine TileData with TileWorkerData
Change-Id: I83536734a54ef7b85f90f56a51878d94fac7ff22
2016-04-07 11:44:27 -07:00
Scott LaVarnway
a2a97b869f VP9: Refactor vp9_decode_block_tokens()
Change-Id: I30ab27808ec903f9490f36621fb16c197bd35d16
2016-04-01 04:57:39 -07:00
James Zern
c20c955e73 vp9/inverse_transform_block_inter: move eob check
1 level up. the function is a no-op for eob == 0 and shouldn't be called

Change-Id: Id0a490bcce78c2b2ec6ea24d942191eb9b2bc16e
2016-03-23 20:41:05 -07:00
James Zern
f64a30acef vp9/inverse_transform_block_intra: move eob check
1 level up. the function is a no-op for eob == 0 and shouldn't be called

Change-Id: I1b4a050424cf2d0ea820120c8e7c4fb3065e39e7
2016-03-23 20:24:17 -07:00
Scott LaVarnway
0499e06f2f VP9: rename vpx_read_mode_info to vp9_read_mode_info
Change-Id: I3cb3da864e33012ba68d61ee8bafa8c42f00313c
2016-02-19 05:34:12 -08:00
James Zern
ac4aeb5714 vp9/decoder,resize_mv_buffer: add missing alloc check
Change-Id: I3bc92175b07d5ef495bd75128638c340f3c2238f
2016-02-17 12:38:40 -08:00
Scott LaVarnway
0ae42ee1bd VP9: Pass NULL scale_factors ptr when not scaling
to vp9_setup_pre_planes(), preventing the function
unscaled_value() from being called.  unscaled_value()
returns the same value that was passed in.  See
scaled_buffer_offset() in vp9_reconinter.h.

Change-Id: I2a6fbaf07972c2f212834929d29a2cbe72e399c3
2016-02-10 11:43:23 -08:00
Scott LaVarnway
7203100127 VP9: Refactor dec_build_inter_predictors_sb()
Change-Id: I336fe2006288214977b5ee854124ee7b5bba5796
2016-01-27 07:37:59 -08:00
Scott LaVarnway
5232326716 VP9: Eliminate MB_MODE_INFO
Change-Id: Ifa607dd2bb366ce09fa16dfcad3cc45a2440c185
2016-01-19 16:40:20 -08:00
Scott LaVarnway
15939cb2d7 Merge "VP9: Eliminate unnecessary nearest/near searches" 2016-01-12 20:00:59 +00:00
Scott LaVarnway
d8aa40634a VP9: Eliminate unnecessary nearest/near searches
Prior to this patch, read_inter_block_mode_info() would
find the nearmv and nearestmv for all modes.  Now it does not
search for ZEROMV modes and breaks out early for NEARMV and
NEWMV modes.

Change-Id: Ifa7b1eaf58bb03b9c7792ea5012fef477527d0fd
2016-01-12 05:09:06 -08:00
Yaowu Xu
2bd4f44409 Assert no mv clamping for scaled references
Under --enable-better-hw-compabibility, this commit adds the asserts
that no mv clamping is applied for scaled references, so when built
with this configure option, decoder will assert if an input bitstream
triggger mv clamping for scaled reference frames.

Change-Id: I786e86a2bbbfb5bc2d2b706a31b0ffa8fe2eb0cb
2016-01-05 14:55:05 -08:00
Scott LaVarnway
2c3b737af6 VP9: Only zero counts when !frame_parallel_decoding_mode (2)
The counts are never used when frame_parallel_decoding_mode
is set.

Change-Id: I293aa68abadcdd30973adacb9f5f5a3aecf8daa2
2015-11-23 14:42:15 -08:00
James Zern
8f7bc45b5b Revert "VP9: Only zero counts when !frame_parallel_decoding_mode"
This reverts commit 380a5519cc.

This causes an assertion failure in debug_check_frame_counts() which
probably isn't valid with this change; leaving the investigation for
later now.

Change-Id: Ieda5ca811ed2fa50a0cc6935919a8d10dca996e0
2015-11-11 11:11:00 -08:00
Scott LaVarnway
380a5519cc VP9: Only zero counts when !frame_parallel_decoding_mode
The counts are never used when frame_parallel_decoding_mode
is set.

Change-Id: Ic7a566a048297f7373c9ffbb48929ea09eff674f
2015-11-09 10:14:13 -08:00
Yaowu Xu
568429512e Add a new enum type vpx_color_range_t
to make meaning of color_range obvious.

Change-Id: I303582e448b82b3203b497e27b22601cc718dfff
2015-10-16 16:27:18 -07:00
James Zern
ba7ea4456f tile_worker_hook: fix -Wclobbered warning
*tile should be marked volatile like the others due to the use of
setjmp()

Change-Id: I5dbf8e6792e4c0f34a683434b4fd06e3b4c75c4b
2015-10-10 11:17:08 -07:00
James Zern
50b20b90aa vp9/decode_tiles_mt: remove unnecessary local
reuse the common loop index

Change-Id: I9db45a93c219c2123917514cb8e9d4ea86454711
2015-10-07 17:46:13 -07:00
James Zern
0bd82af834 vp9/tile_worker_hook: pass pbi directly
reduces the size of TileWorkerData reusing the storage in the worker
itself

Change-Id: If8a62fcb35167037c3da5814ab84fb81893f9cab
2015-10-06 20:14:24 -07:00
James Zern
1f4a6c8a4e vp9/tile_worker_hook: add multiple tile decoding
this reduces the number of synchronizations in decode_tiles_mt() and
improves overall performance when the number of threads is less than the
number of tiles

Change-Id: Iaee6082673dc187ffe0e3d91a701d1e470c62924
2015-10-06 20:13:54 -07:00
Scott LaVarnway
66de2b710f Merge "VP9: move loopfilter build masks to decode loop" 2015-09-29 21:40:48 +00:00
Scott LaVarnway
7718117104 VP9: move loopfilter build masks to decode loop
The loopfilter masks are now built in the decode loop.
This is done so we can eventually reduce the number of
MODE_INFO structs required by the decoder.

The encoder builds the masks for the entire frame prior
to calling the loopfilter.

Change-Id: Ia2146b07e0acb8c50203e586dfae0c4c5b316f11
2015-09-29 05:20:49 -07:00
Ronald S. Bultje
812945a8f1 vp9/10: improve support for render_width/height.
In the decoder, map this to the output variable vpx_image_t.r_w/h.
This is intended as an improved version of VP9D_GET_DISPLAY_SIZE,
which doesn't work with parallel frame decoding. In the encoder,
map this to a codec control func (VP9E_SET_RENDER_SIZE) that takes
a w/h pair argument in a int[2] (identical to VP9D_GET_DISPLAY_SIZE).

Also add render_size to the encoder_param_get_to_decoder unit test.

See issue 1030.

Change-Id: I12124c13602d832bf4c44090db08c1009c94c7e8
2015-09-25 22:18:22 -04:00
Ronald S. Bultje
36ffe64498 Rename display_{size,width,height} to render_*.
The name "display_*" (or "d_*") is used for non-compatible information
(that is, the cropped frame dimensions in pixels, as opposed to the
intended screen rendering surface size). Therefore, continuing to use
display_* would be confusing to end users. Instead, rename the field
to render_*, so that struct vpx_image can include it.

Change-Id: Iab8d2eae96492b71c4ea60c4bce8121cb2a1fe2d
2015-09-25 21:34:29 -04:00
James Zern
9d8decc162 Merge changes from topic 'tile-thread-cleanup'
* changes:
  vp9/decode_tiles_mt: move frame count accum from loop
  VP9Decoder: remove duplicate tile_worker_info
  vp9/decode_tiles_mt: move some inits from inner loop
  vp9_accumulate_frame_counts: pass counts directly
2015-09-17 22:00:23 +00:00
Ronald S. Bultje
eeb5ef0a24 Add support for color-range.
In decoder, export (eventually) into vpx_image_t.range field. In
encoder, use oxcf->color_range to set it (same way as for
color_space).

See issue 1059.

Change-Id: Ieabbb2a785fa58cc4044bd54eee66f328f3906ce
2015-09-16 06:41:46 -04:00
James Zern
ad0ac045d5 vp9/decode_tiles_mt: move frame count accum from loop
the check performed within the while was redundant; simply place the
accumulation after all tiles are decoded.

Change-Id: I6a74e87257c775fd8bfc8ac4511e4a6ad8f18346
2015-09-04 20:24:29 -07:00
James Zern
5e1e6a9f17 VP9Decoder: remove duplicate tile_worker_info
unnecessary since: 86f4a3d Remove tile param

Change-Id: Iff75d3acf6c5aade833ea0a214c919279403cf97
2015-09-04 19:47:33 -07:00
James Zern
2d06b08cba vp9/decode_tiles_mt: move some inits from inner loop
worker copies of pbi/xd/counts only need to be initialized once

Change-Id: I0081a85b9c82d39573c22d2fd2c670ec2f7b8715
2015-09-04 19:47:33 -07:00
James Zern
0548046ae3 vp9_accumulate_frame_counts: pass counts directly
Change-Id: Ic3c6cfba5b1867c335f2834da936e20caec8597a
2015-09-04 19:47:33 -07:00
Johann
c5f11912ae Include vpx_dsp_common.h when using VPXMIN/MAX
Change-Id: I2e387a06484a06301f3cd6600c4ba2f4335b61ee
2015-08-31 14:36:35 -07:00
James Zern
5e16d397bd vpx_dsp_common: add VPX prefix to MIN/MAX
prevents redeclaration warnings;
vp8 has its own define which will be resolved in a future commit

Change-Id: Ic941fef3dd4262fcdce48b73075fe6b375f11c9c
2015-08-26 20:11:32 -07:00