Commit Graph

34 Commits

Author SHA1 Message Date
angiebird
7122eea6a4 Cosmetic change for simple_encode_test.cc
Change-Id: I50b4d38f7deceb5b416e72dd944d2ed31e42dafa
2020-08-10 16:06:49 -07:00
angiebird
246a65c696 Make target_frame_bits error margin configurable.
Change-Id: I05dd4d60741743c13951727ce6608acf4224ebec
2020-08-10 15:00:51 -07:00
angiebird
3ec043a795 Add rq_history to encode_frame_result
Change-Id: Ic2a52dcf5e5a6d57b80d390a2c48ee498e89e7b2
2020-08-07 16:48:08 -07:00
angiebird
bb7a2ccc38 Fix ObserveFirstPassMotionVectors()
1) Use kRefFrameTypeNone in the unit test
2) Reset mv_info in fp_motion_vector_info_init
3) Call fp_motion_vector_info_init() in first_pass_encode()
4) Set mv_info for intra frame.
5) Set mv_info with zero mv as default for inter frame
6) Remove duplicated fp_motion_vector_info in encode_frame_info

Change-Id: I2f7db5cd4cf1f19db039c9ce638d17b832f45b6e
2020-08-07 15:48:32 -07:00
Cheng Chen
f9ab864199 L2E: Add ObserveFirstPassMotionVector
Store motion vectors for each 16x16 block found in the first pass
motion search.
Provide an api "ObserveFirstPassMotionVector()" in SimpleEncode
class, similar to "ObserveFirstPassStats()".

Change-Id: Ia86386b7e4aa549f7000e7965c287380bf52e62c
2020-08-03 22:46:38 -07:00
angiebird
56345d256a Build libsimple_encode.a separately
BUG=webm:1689

Change-Id: Id920816315c6586cd652ba6cd1b3a76dfc1f12b7
2020-07-17 18:04:09 -07:00
angiebird
e753d4930f Let SetExternalGroupOfPicturesMap use c-style arr
Change-Id: Ic92ce5a3cc5bb74120eb32fc6219e43b1b861f14
2020-06-11 15:10:38 -07:00
angiebird
d1ed2f0d7a Refactor simple_encode_test.cc
1) Avoid using global variables.

2) Add comments to EncodeConsistencyTest.

3) Check frame_type and show_idx in EncodeConsistencyTest.

Change-Id: I2261a0bd65189beb70432d62c077ef618a2712ab
2020-06-02 15:27:59 -07:00
angiebird
34034789d7 Add extra check / unit test to SetExternalGroupOfPicturesMap()
Let SetExternalGroupOfPicturesMap() modify the gop_map_ to satisfy
the following constraints.
1) Each key frame position should be at the start of a gop.
2) The last gop should not use an alt ref.

Add unit test for SetExternalGroupOfPicturesMap()

Change-Id: Iee9bd238ad0fc5c2ccbf2fbd065a280c854cd718
2020-05-28 18:07:12 -07:00
angiebird
23b070f46e Add functions to compute/observe key frame map
Change-Id: I2fc0efb2ac35e64af3350bddaa802a206d1aa13c
2020-05-26 23:33:03 -07:00
angiebird
5c8431b9e4 Make SetExternalGroupOfPicture support no arf mode
Rename external_arf_indexes by gop_map

Use kGopMapFlagStart to indicate the start of a gop in the gop_map.
Use kGopMapFlagUseAltRef to indicate whether to use altref in the
gop_map.

Change-Id: I743e3199a24b9ae1abd5acd290da1a1f8660e6ac
2020-05-26 23:30:57 -07:00
angiebird
e7aa1e3630 Add unit test for ref_frame_info
Fix several bugs to make the test pass.
1) Move update_frame_indexes() out of show_frame check.
2) Init coding_indexes[i] to -1 when key frame appears
3) Fix a bug in PostUpdateRefFrameInfo()

Change-Id: Ie7c70a1d460e5b89475a1aef77416fc9a88387e1
2020-03-03 10:57:03 -08:00
Cheng Chen
8a96ad8f47 Make external arf consistent with vp9
Add a test to ensure that encoding with the external arfs gets the
same result as long as the arfs are the same as the vp9 baseline.

Change-Id: I92c79001018f4df3bc16e9fc56c733509bebb9dc
2020-02-24 19:06:57 -08:00
angiebird
da3e3ecc7b Consistency test for GroupOfPicture
Make sure frame_type, show_idx and coding_index in GroupOfPicture
match the results in EncodeFrameInfo.

Change-Id: I3b477a03b5efd651c2d174e7146a4cd4f5551604
2020-02-20 16:35:30 -08:00
angiebird
a6238a1085 Use ObserveGroupOfPicture() in EncodeFrame test
In the previous version, we assume the number of coding frames is
known.

Although the assumption is true for now with rate_ctrl flag on,
it's more proper to use ObserveGroupOfPicture() to get
the partial info about how many coding frames are in the group.

Because We want to keep the flexibility of changing the size of
group of pictures on the fly in the future.

Change-Id: Ibbe6ab49268c468bf1cef8344efd3a3e1eab972a
2020-02-20 16:25:31 -08:00
Cheng Chen
69b30b37fd Add a unit test to check partition info
Change-Id: I397d7005961a037c9c9cb29e3ff0a3d39a501d15
2020-02-10 21:39:37 -08:00
Cheng Chen
3329c0e15f Consistency test for motion vector info
Change-Id: Ie1d77e231b973eb16f4e9c520721b47cdf86622c
2020-02-06 11:54:51 -08:00
Cheng Chen
db900e5268 Consistency test for partition info
Test the information stored in the encoder is the same
between two encode runs.

Change-Id: I4f97fac4f212602f766aee0a6cbef566ca43b41e
2020-01-27 13:34:08 -08:00
James Zern
b809ac3c9e simple_encode*.cc: add missing copyright
Change-Id: I58ddf13698e3892aa591af4196ca03d7c09426c6
2020-01-10 16:47:48 -08:00
angiebird
a53b7e53e8 Add GetFramePixelCount to SimpleEncode
Gets the total number of pixels of YUV planes per frame.

Change-Id: Ifdf35190cdde1378de6d7e93ab4428868a5795fa
2019-12-12 12:03:28 -08:00
angiebird
757a5e6aa9 Add GetNextEncodeFrameInfo ObserveGroupOfPicture
GetNextEncodeFrameInfo()
Gets encode_frame_info for the next coding frame.

ObserveGroupOfPicture()
Provides the group of pictures that the next coding frame is in.

Change-Id: Idbc437d32c392f25b06efb2d4e1ec01347d678f2
2019-12-10 11:41:01 -08:00
angiebird
42916ce604 Fix the encode inconsistency of SimpleEncode
Make sure restore_coding_context() is always called in the end
of encode_with_recode_loop().

Add EncodeConsistencyTest.

Change-Id: I3c8e4c8fcff4e3f7afef9bec469beef2a5fb6eeb
2019-12-03 18:33:10 -08:00
angiebird
2157d613c5 Cosmetic change of GetBitrateInKbps
Change-Id: Id4b852cdfba0f6fa1e12a05e2617df0de395be9d
2019-11-25 10:37:07 -08:00
angiebird
585eb34f86 Cosmetic changes of SimpleEncode code
Change-Id: Ied06630d605a4978711070778b92bfb731c32161
2019-11-21 10:54:23 -08:00
angiebird
89077d4505 Fix a bug in EncodeFrame test
Move key frame checks after EncodeFrame()

Change-Id: I4e3eded5dc54e757f85e846c4920cddc1ea7444b
2019-11-20 10:41:16 -08:00
angiebird
38b636094b Add namespace vp9
Change-Id: I29d05557becbfc5d55d1cd1bb709e519d27c928b
2019-11-20 10:41:16 -08:00
angiebird
6a950fee92 Add coding_data_bit_size to EncodeFrameResult
Change-Id: I32ab6829083c896ab2c6234e191939a000dea6e5
2019-11-18 11:37:24 -08:00
angiebird
21e93eb814 Pass in infile_path to SimpleEncode()
Change-Id: If47867d4d59a59e252bfe7eb24c940f9e089d335
2019-11-18 11:37:24 -08:00
angiebird
c4f1fe4b22 Add SimpleEncode::EncodeFrameWithQuantizeIndex()
Change-Id: I4442de01dfdbf13b0b9f7830f0fb393d3b935522
2019-11-18 11:37:24 -08:00
angiebird
56735c3fdb Add psnr and sse to EncodeFrameResult
Change-Id: I33c410a14b86f95278eff8d1d0e6992f1b82a17d
2019-11-18 11:37:24 -08:00
angiebird
6956e393c7 Add frame_type and show_idx to EncodeFrameResult
Let vp9_get_compressed_data update ENCODE_FRAME_RESULT, a C
version of EncodeFrameResult.
Let unit test to test frame_type and show_idx properly.

Change-Id: Id810c26c826254fd82249f19ab855ea3b440d99c
2019-11-18 11:37:24 -08:00
angiebird
f975d02d6d Add EncodeFrameResults
It contains coding_data_size and coding_data.

The EncodeFrame will allocate a buffer, write the coding data into the
buffer and give the ownership of the buffer to
encode_frame_result->coding_data

Change-Id: I6bd86aede191ade1db4a1f1bba5be601eef97d60
2019-11-18 11:37:24 -08:00
angiebird
422445a81d Add SimpleEncode::GetCodingFrameNum()
Also add unit tests for GetCodingFrameNum() and EncodeFrame()

Change-Id: I3e7b65f47226be4660409481435f8f784db72a68
2019-11-18 11:37:24 -08:00
angiebird
7ee697a5da Add ComputeFirstPassStats()
Change-Id: Iaed87a4fa35f456aec5d88d07fade636280eb211
2019-11-18 11:37:24 -08:00