Commit Graph

58 Commits

Author SHA1 Message Date
Ronald S. Bultje
6a032503ca vp10: don't allow comp_inter_inter on keyframes.
Change-Id: Ibd0e13721a2bb71c532d20b36c42f4cccf5c5de2
2015-10-21 15:19:11 -04:00
Ronald S. Bultje
dec4405cfa vp10: disallow coding zero-sized tiles-in-frame/frames-in-superframe.
See issue 1088.

Change-Id: Icb15d33b4e316add848f210b50cbccd7c7847207
2015-10-20 14:48:31 -04:00
Ronald S. Bultje
2a388b53f2 vp10: write colorspace info for profile 0 intraonly frames.
See issue 1087.

Change-Id: I231f6f12f870d0a56391daf1673536048418b207
2015-10-19 12:18:57 -04:00
Ronald S. Bultje
60c58b5284 vp10: per-segment lossless coding.
Some more testing of this patch would probably be useful, but I
think the basics of it should work fine now.

See issue 1035.

Change-Id: I4a36d58f671c5391cb09d564581784a00ed26245
2015-10-16 19:30:39 -04:00
Ronald S. Bultje
c7dc1d78bf vp10: add extended-intra prediction edges experiment.
This experiment allows using full above/right edges for all transform
sizes whenever available (for d45/d63), and adds bottom/left edges for
d207.

See issue 1043.

Change-Id: I5cf7f345e783e8539bb6b6d2c9972fb1d6d0a78b
2015-10-16 19:30:39 -04:00
Ronald S. Bultje
1eb51a2010 vp10: allow forward updates for keyframe y intra mode probabilities.
See issue 1040 point 5.

Change-Id: I51a70b9eade39efba392a1457bd70a3c515525cb
2015-10-16 19:30:38 -04:00
Ronald S. Bultje
d8f3bb1837 vp10: merge keyframe/interframe uvintramode/partition probabilities.
This has various benefits:
- simplify implementations because we don't have to switch between
  multiple probability tables depending on frametype
- allows fw subexp and bw adaptivity for partitions/uvmode in keyframes

See issue 1040 point 5.

Change-Id: Ia566aa2863252d130cee9deedcf123bb2a0d3765
2015-10-16 19:30:38 -04:00
Ronald S. Bultje
6e5a1165be vp10: make segmentation probs use generic probability model.
Locate them (code-wise) in frame_context, and have them be updated
as any other probability using the subexp forward and adaptive bw
updates.

See issue 1040 point 1.

TODOs:
- real-world default probabilities
- why is counts sometimes NULL in the decoder? Does that mean bw
  adaptivity updates only work on some frames? (I haven't looked
  very closely yet, maybe this is a red herring.)

Change-Id: I23b57b4e5e7574b75f16eb64823b29c22fbab42e
2015-10-16 19:30:38 -04:00
hui su
aaf6f6215f Fix palette mode in multi-thread encoding setting
Fix a couple of memory related errors. Also fix thread test failures.

Change-Id: I0103995f832cecf1dd2380000321ac7204f0cfc0
2015-10-15 15:00:57 -07:00
Hui Su
b9e31b5163 Merge "VP10: Add palette mode part 1" 2015-10-13 17:34:27 +00:00
Ronald S. Bultje
00170953b1 vp10: allow forward updates for uv_mode probabilities.
See issue 1040 point 4.

Change-Id: I79e06bd71a27f45770c760c47dc71bc3767a77a0
2015-10-12 17:51:01 -04:00
Ronald S. Bultje
5f589826f3 vp10: allow bw adaptivity for skip/tx probabilities in keyframes.
See issue 1040 point 3.

Change-Id: Ieef6d326b7fb50ceca5936525b7c688225a11fd1
2015-10-12 17:51:01 -04:00
Ronald S. Bultje
5b4805d6e9 vp10: remove clamp_mv2() call from vp10_find_best_ref_mvs().
This actually has no effect whatsoever, since the input MVs themselves
are clamped by clamp_mv_ref() already, which is significantly more
restrictive in its bounds.

Change-Id: I4a3a7b2b121ee422c56428c2a12d930c3813c06e
2015-10-12 14:45:18 -04:00
hui su
5d011cb278 VP10: Add palette mode part 1
Add palette mode for keyframe luma channel. Palette mode is enabled
when using "--tune-content=screen" in encoding config parameters.

on screen_content testset:  +6.89%
on derlr                 :  +0.00%

Design doc (WIP):
https://goo.gl/lD4yJw

Change-Id: Ib368b216bfd3ea21c6c27436934ad87afdaa6f88
2015-10-12 10:02:17 -07:00
Ronald S. Bultje
177e7b53e7 vp10: use subexp probability updates for MV probs.
See issue 1040 point 2.

Change-Id: I0b37fe74be764610696620f1fe296dc74e4806d7
2015-10-05 20:58:32 -04:00
Ronald S. Bultje
3461e8ce64 vp10: skip unreachable cat6 token extrabits.
We have historically added new bits to cat6 whenever we added a new
transform size (or bitdepth, for that matter). However, we have
always coded these new bits regardless of the actual transform size,
which means that for smaller transforms, we code bits that cannot
possibly be set. The coding (quality) impact of this is negligible,
but the bigger issue is that this allows creating bitstreams with
coefficient values that are nonsensible and can cause int overflows,
which then de facto become part of the bitstream spec. By not coding
these bits, we remove this possibility.

See issue 1065.

Change-Id: Ib3186eca2df6a7a15ddc60c8b55af182aadd964d
2015-10-05 20:58:32 -04:00
Ronald S. Bultje
d77a84bf52 vp10: remove superframe size field for last frame in superframe.
This is identical to what the tile size does for the last tile. See
issue 1042 (which covers generalizing the superframe/tile concepts).

Change-Id: I1f187d2e3b984e424e3b6d79201b8723069e1a50
2015-10-05 20:58:32 -04:00
Ronald S. Bultje
7460798ba5 vp10: use superframe marker index/size mechanism for tile size.
See issue 1042. Should provide slight bitstream savings in most cases
where tiles are being used.

Change-Id: Ie2808cf8ef30b3efe50804396900c4d63a3fa026
2015-10-05 20:58:32 -04:00
Ronald S. Bultje
612104bb8d vp10: extend range for delta Q values.
See issue 1051. 6 bits is fairly arbitrary but at least allows writing
delta Q values that are fairly normal in other codecs. I can extend to
8 if people want full range, although I personally don't have any need
for that.

Change-Id: I0a5a7c3d9b8eb3de4418430ab0e925d4a08cd7a0
2015-10-05 20:58:32 -04:00
Ronald S. Bultje
ce3780251c vp10: make render_width/height referenceable through ref frames.
See issue 1079.

Change-Id: I754a61ec011c3508bbb26826cf8e11dbdfdd8379
2015-10-02 13:39:38 -04: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
Ronald S. Bultje
8979e9e387 vp10: code reference_mode in uncompressed header.
See issue 1041 point 2.

Change-Id: I6fc6427b1a0edff828e39d43428e3271491f8ac5
2015-09-25 20:32:14 -04:00
Ronald S. Bultje
bab8d38f7f vp10: remove MACROBLOCK.{highbd_,}itxfm_add function pointer.
This is preparatory work for allowing per-segment lossless coding.

See issue 1035.

Change-Id: I9487d02717ee3e766aee61a487780056bb35d2d3
2015-09-25 19:30:46 -04:00
James Zern
921c347ef6 vp9/10 decoder_remove: check pbi pointer
fixes crash on error

Change-Id: Ibb1ef5565fb833cdee1a49335473d98f1187ef43
2015-09-24 19:51:14 -07:00
Ronald S. Bultje
50f944272c vp10: do sub8x8 block reconstruction in full subblocks.
This means that we don't reconstruct in 4x4 dimensions, but in
blocksize dimensions, e.g. 4x8 or 8x4. This may in some cases lead
to performance improvements. Also, if we decide to re-introduce
scalable coding support, this would fix the fact that you need to
re-scale the MV halfway the block in sub8x8 non-4x4 blocks.

See issue 1013.

Change-Id: If39c890cad20dff96635720d8c75b910cafac495
2015-09-16 19:35:54 -04:00
Ronald S. Bultje
ed29c2f945 vp10: fix 4:2:2 chroma MVs for 8x4/4x4 blocks.
In vp9, the bottom MV would be the average of the topright and
bottomleft luma MV (instead of the bottomleft/bottomright luma MV).

See issue 993.

Change-Id: Ic91c0b195950e7b32fc26c84c04788a09321e391
2015-09-16 19:35:54 -04:00
Ronald S. Bultje
00a203b7bc vp10: move coding of tx_mode element to the non-arithcoded header.
See issue 1040 point 3.

Change-Id: If051b92c24a34d6a39861fb7d7180c5ca32f3d82
2015-09-16 19:35:53 -04:00
Ronald S. Bultje
a3df343cda vp10: code sign bit before absolute value in non-arithcoded header.
For reading, this makes the operation branchless, although it still
requires two shifts. For writing, this makes the operation as fast
as writing an unsigned value, branchlessly. This is also how other
codecs typically code signed, non-arithcoded bitstream elements.

See issue 1039.

Change-Id: I6a8182cc88a16842fb431688c38f6b52d7f24ead
2015-09-16 19:35:03 -04:00
Ronald S. Bultje
a5d930e464 vp10: don't reset contextual skip flag if block has no coefficients.
The implicitly changed value would be used for contextualizing future
skip flags of neighbour blocks (bottom/right), which is certainly not
what was intended. The original code stems from vp8, and was useful
in cases where coding of the skip flag was disabled. In vp9, the skip
flag is always coded. The result of this change is that for bitstream
parsing purposes, decoding of the skip flag becomes independent of
decoding of block coefficients.

See issue 1014.

Change-Id: I8629e6abe76f7c1d649f28cd6fe22a675ce4a15d
2015-09-16 06:41:51 -04: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
Ronald S. Bultje
e562c71783 Merge "vp10: fix entropy counts for the hp bit." 2015-09-16 01:53:44 +00:00
James Zern
c667593e1e Merge changes from topic 'fix-vp9-bitstream-test'
* changes:
  vp9_encoder_parms_get_to_decoder: cosmetics
  vp9...parms_get_to_decoder: remove unneeded func
  vp9...parms_get_to_decoder: fix EXPECT param order
  vp9_encoder_parms_get_to_decoder: delete dead code
  fix BitstreamParms test
  vp9_encoder_parms_get_to_decoder: remove vp10
  yuvconfig2image(): add explicit cast to avoid conv warning
  vp9/10 decoder_init: add missing alloc cast
  vp9/10: set color_space on preview frame
  vp10: add extern "C" to headers
  vp9: add extern "C" to headers
2015-09-15 23:14:34 +00:00
Yaowu Xu
ee825f9372 Remove leftover of "frame_parallel_decoding"
The variable has been removed by a previous commit, but missed this
instance.

Change-Id: Ia34474b0be4945cc6cb9191f0d7cd24a99a4c22e
2015-09-14 18:10:08 -07:00
Ronald S. Bultje
1e9e9ce2dc vp10: fix entropy counts for the hp bit.
The counts didn't take usehp into account, which means that if the
scope of the refmv is too large for the hp bit to be coded, the value
(always 1) is still included in the stats. Therefore, the final
counts will not reflect the entropy of the coded bits, but rather the
entropy of the combination of coded bits and the implied value (which
is always 1). Fix that by only including counts if the hp bit is
actually coded.

See issue 1060.

Change-Id: I19a3adda4a8662a05f08a9e58d7e56ff979be11e
2015-09-14 16:13:59 -04:00
Ronald S. Bultje
d1474f02aa vp10: merge frame_parallel_decoding_mode and refresh_frame_context.
See issue 1030. The value of frame_parallel_decoding_mode was ignored
in vp9 if refresh_frame_context was 0, so instead make it a 3-member
enum where the dependency is obviously stated.

Change-Id: I37f0177e5759f54e2e6cc6217023d5681de92438
2015-09-11 19:33:46 -04:00
Ronald S. Bultje
ef73bbf778 vp10: remove duplicate frame_parallel_decode field.
Keep the one in VP10_COMMON in favour of the one in VP10_DECODER.

Change-Id: Ia81983ccc95d83829dc815e28d9b1143e16e27b1
2015-09-11 18:37:24 -04:00
Ronald S. Bultje
62da0bf162 Make reset_frame_context an enum.
In vp9, [0] and [1] had identical meaning, so merge them into a
single value. Make it impossible to code RESET_FRAME_CONTEXT_NONE
for intra_only frames, since that is a non-sensical combination.

See issue 1030.

Change-Id: If450c74162d35ca63a9d279beaa53ff9cdd6612b
2015-09-11 15:12:02 -04:00
James Zern
55f5d557f2 vp10: add extern "C" to headers
Change-Id: Ie2e8b37fa01ce8d6b993684f431f3159d511cfb1
2015-09-09 23:15:59 -07:00
Ronald S. Bultje
d88cee3712 Make update_map/temporal_update fields implicit for keyframes.
These frame types cannot make bitstream parsing depend on previous
frames, so the hypothetical combinations of e.g. keyframe=1 and
update_map=0 or keyframe=1 and temporal_update=1 are non-sensical.
Therefore, make it impossible to code such combinations in the vp10
bitstream header.

See issue 1044.

Change-Id: I3f0a83d5c7e3989541a469a909471424a285239d
2015-09-03 21:19:45 -04:00
Ronald S. Bultje
ecd34e6494 Unify coding order of MC filters between blocks and frame header.
In VP9, the order for frame header was: [0] smooth, [1] regular, [2]
sharp, [3] bilinear. Per-block, the order was [0] regular, [1] smooth
and [2] sharp. For VP10, swap smooth/regular in the frame header so
that the block ordering and frame header ordering are interchangeable.

See issue #1046.

Change-Id: Ic9ec5964874375e40cd59bef50b489a76cbe4365
2015-09-03 09:34:55 -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
hui su
d88ca3c335 Fix a bug induced in f1d090e2f5
Change-Id: I5f7ab8ee75192a4c6c7aa723d2e113400d6ca9a5
2015-08-24 13:46:05 -07:00
hui su
d76e5b3652 Refactoring on transform types
Prepare for adding more transform varieties (EXT_TX and TX_SKIP in nextgen).

Change-Id: I2dfe024f6be7a92078775917092ed62abc2e7d1e
2015-08-24 10:47:25 -07:00
Hui Su
cd14e03196 Merge "Refactor get_tx_type and get_scan" 2015-08-21 23:21:04 +00:00
hui su
5eed74e1d3 Refactor get_tx_type and get_scan
This makes it easier to add new transform types and scan orders
to VP10 in the future.

Change-Id: I94874ddc9b19928d7820d57e94e2af04adf51efe
2015-08-21 09:53:37 -07:00
Jingning Han
c455919f03 Replace MAX_REF_LF_DELTAS with MAX_REF_FRAMES
The macro MAX_REF_LF_DELTAS is repeatedly defined. Merge its use
cases with MAX_REF_FRAMES.

Change-Id: I71c4634fb5feae78ce6f9bf99074f45ed7f68b73
2015-08-20 09:52:52 -07:00
Jingning Han
bbb9ca4535 Merge "Change vp9_ prefix function names in vpx_scale to vpx_" 2015-08-15 22:40:11 +00:00
Jingning Han
89af744ba6 Change vp9_ prefix function names in vpx_scale to vpx_
Change-Id: Iac85902cbbb3e752801dc85de9a3c778e47304aa
2015-08-14 15:27:43 -07:00