Commit graph

14 commits

Author SHA1 Message Date
XuGuangxin
dc583452d8 libs: encoder: h264: Add machinery for implementing hierarchical-prediction
Adds some basic building blocks to ease the implementation
of hierarchical prediction modes.

-- add an utility method to find temporal level of each frame
-- define max_ref_frame count based on temporal level count
-- add temporal_level_div[] for finding temporal level each frame
to be encoded.
-- find ip_period based on temporal level count

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=788918
2017-11-08 12:33:50 +01:00
XuGuangxin
89717a447f libs: encoder: objects: Add a reference flag
We can have p-frame as non-ref and also b-frame as ref
which are not supported yet. Reference flag
is the first machinery needed for more advanced
reference picture selection modes.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=788918
2017-11-08 12:33:50 +01:00
Sreerenj Balachandran
de2e4cd9bc FEI: libs: Add fei codec objects to GstVaapiEncPicture
All the codec objects(vaapi buffers) supposed to be
submited in vaRenderPicutre are associated with a GstVaapiEncPicture
for each frame, follow the same design for FEI too.

https://bugzilla.gnome.org/show_bug.cgi?id=785712
https://bugzilla.gnome.org/show_bug.cgi?id=784667
2017-09-01 11:32:24 +02:00
Víctor Manuel Jáquez Leal
3ec7996d75 libs: encoder: fix a comment 2017-05-12 11:12:56 +02:00
Sreerenj Balachandran
4f343f82e3 encoders: add quality level tuning
This patch adds the handling of VAEncMiscParameterTypeQualityLevel,
in gstreamer-vaapi encoders:

  The encoding quality could be set through this structure, if the
  implementation supports multiple quality levels. The quality level set
  through this structure is persistent over the entire coded sequence, or
  until a new structure is being sent. The quality level range can be queried
  through the VAConfigAttribEncQualityRange attribute. A lower value means
  higher quality, and a value of 1 represents the highest quality. The quality
  level setting is used as a trade-off between quality and speed/power
  consumption, with higher quality corresponds to lower speed and higher power
  consumption.

The quality level is set by the element's parameter "quality-level" with a
hard-coded range of 1 to 8.

Later, when the encoder is configured in run time, just before start
processing, the quality level is scaled to the codec range. If
VAConfigAttribEncQualityRange is not available in the used VA backend, then
the quality level is set to zero, which means "disabled".

All the available codecs now process this parameter if it is available.

https://bugzilla.gnome.org/show_bug.cgi?id=778733

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2017-05-11 11:51:56 +02:00
Víctor Manuel Jáquez Leal
b1bbc087c1 encoder: avoid GstVaapiCodedBuffer redefinition
The symbol GstVaapiCodedBuffer is already defined in
gst-libs/gst/vaapi/gstvaapicodedbuffer.h which is loaded, at the end, by
gstvaapiencoder_objects.h. Clang complains about the symbol re-definition.

This patch removes that redefinition.

https://bugzilla.gnome.org/show_bug.cgi?id=747312
2015-04-08 16:20:55 +02:00
Sreerenj Balachandran
f8020bb03e encoder_objects: Add QuantizationMatrix and JPEGHuffmanTable 2015-02-04 11:15:38 +02:00
Sreerenj Balachandran
786b68ac21 encoder: add infrastructure for per-slice handling of packed headers.
The packed slice header and packed raw data need to be paired with
the submission of VAEncSliceHeaderParameterBuffer. So handle them
on a per-slice basis insted of a per-picture basis.

[removed useless initializer]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-06-17 16:03:33 +02:00
Gwenole Beauchesne
6bf3c1863c legal: update copyright notice dates. 2014-01-22 19:02:35 +01:00
Gwenole Beauchesne
1c95903b98 legal: add per-file authorship information. 2014-01-22 18:49:20 +01:00
Gwenole Beauchesne
d45c6a486f encoder: clean-up objects.
Various clean-ups to improve consistency and readability: rename some
variables, drop unused macro definitions, drop initialization of vars
that are zero-initialized from the base class, drop un-necessary casts,
allocate GPtrArrays with a destroy function.
2014-01-14 15:28:19 +01:00
Gwenole Beauchesne
0fb7c60508 encoder: rework GstVaapiCodedBuffer and related proxy.
Refactor the GstVaapiCodedBuffer APIs so that to more clearly separate
public and private interfaces. Besides, the map/unmap APIs should not
be exposed as is but appropriate accessors should be provided instead.

* GstVaapiCodedBuffer: VA coded buffer abstraction
- gst_vaapi_coded_buffer_get_size(): get coded buffer size.
- gst_vaapi_coded_buffer_copy_into(): copy coded buffer into GstBuffer

* GstVaapiCodedBufferPool: pool of VA coded buffer objects
- gst_vaapi_coded_buffer_pool_new(): create a pool of coded buffers of
  the specified max size, and bound to the supplied encoder

* GstVaapiCodedBufferProxy: pool-allocated VA coded buffer object proxy
- gst_vaapi_coded_buffer_proxy_new_from_pool(): create coded buf from pool
- gst_vaapi_coded_buffer_proxy_get_buffer(): get underlying coded buffer
- gst_vaapi_coded_buffer_proxy_get_buffer_size(): get coded buffer size

Rationale: more optimized transfer functions might be provided in the
future, thus rendering the map/unmap mechanism obsolete or sub-optimal.

https://bugzilla.gnome.org/show_bug.cgi?id=719775
2013-12-04 19:14:38 +01:00
Gwenole Beauchesne
30f382fcdf vaapiencode: optimize _handle_frame() to avoid extra allocation.
Optimize gst_vaapiencode_handle_frame() to avoid extra memory allocation,
and in particular the GstVaapiEncObjUserData object. i.e. directly use
the VA surface proxy from the source buffer. This also makes the user
data attached to the GstVideoCodecFrame more consistent between both
the decoder and encoder plug-in elements.
2013-11-28 17:32:18 +01:00
Wind Yuan
8174a35737 Add initial infrastructure for video encoding.
Add initial API for video encoding: only basic interfaces and small
encoder objects are implemented so far.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-11-24 16:52:05 +01:00