Dune HD STB - ZOOM MODES


Playback engine of Dune HD STB supports various zoom modes for video
playback. Zoom mode determines how the source video picture is
scaled/transformed when rendering to the video output. This may include
aspect ratio change.

Dune native UI supports several fixed zoom modes (also called "zoom
presets") and also supports user-configurable custom zoom mode.

Applications based on Dune STB API can only use the fixed zoom modes (and
can alter the displayed video window via additional settings).

In most cases, if the video itself is encoded correctly and optimally (with
correct aspect ratio and w/o black bars embedded in the video itself) the
most useful zoom modes are the following fixed zoom modes (for more
details, see "Fixed zoom modes" section):
   - NORMAL: ensure the entire video picture is shown (possibly with black
     bars added).
   - FULL_SCREEN: ensure there are no black bars shown.

Fixed zoom modes

NORMAL
   - The video is scalled to fit the entire screen, w/o any aspect ratio
     changes. If aspect ratio of the video is different from the aspect
     ratio of the screen, black bars (top and bottom or left and right)
     are added.
   - Typical usage: normal playback.

FULL_SCREEN
   - The video is scalled to fill the entire screen, w/o any aspect ratio
     changes. If aspect ratio of the video is different from the aspect
     ratio of the screen, the top and bottom or the left and the right
     parts of the video are cut to ensure the video fills the entire
     screen.
   - Typical usage: eliminate black bars preserving aspect ratio.

STRETCH_TO_FULL_SCREEN
   - The video is scalled to fill the entire screen w/o preserving the
     aspect ratio. If aspect ratio of the video is different from the
     aspect ratio of the screen, the aspect ratio of the video is changed
     to ensure the video fills the entire screen.
   - Typical usage: eliminate black bars w/o preserving aspect ratio.

ENLARGE
   - The same as NORMAL, but the video is scalled both horizontally and
     vertically by the factor 4/3.
   - Typical usage: eliminate black bars embedded into the video itself.

MAKE_WIDER
   - The same as NORMAL, but the video is scalled horizontally by the
     factor 4/3.
   - Typical usage: correct wrong aspect ratio.

MAKE_TALLER
   - The same as NORMAL, but the video is scalled vertically by the factor
     4/3.
   - Typical usage: correct wrong aspect ratio.

CUT_EDGES
   - The same as NORMAL, but the video is slightly scalled both
     horizontally and verticalled inside the original bounds of the video
     (i.e. small portion of the video is cut on all sides of the video).
   - Typical usage: cut the garbage at sides of the video.

NON_LINEAR_STRETCH
   - A special mode allowing to use non-linear horizontal video strecthing.

NON_LINEAR_STRETCH_TO_FULL_SCREEN
   - A special mode allowing to use non-linear strecthing video
     streteching, with more aggressive screen filling.

Fixed zoom modes values

In JS STB API, fixed zoom modes are available via the following constants
(see js_stb_sdk-*/doc/dune_js_stb_api.txt):
   VIDEO_ZOOM_NORMAL
   VIDEO_ZOOM_ENLARGE
   VIDEO_ZOOM_MAKE_WIDER
   VIDEO_ZOOM_NON_LINEAR_STRETCH
   VIDEO_ZOOM_NON_LINEAR_STRETCH_TO_FULL_SCREEN
   VIDEO_ZOOM_MAKE_TALLER
   VIDEO_ZOOM_CUT_EDGES
   VIDEO_ZOOM_FULL_SCREEN
   VIDEO_ZOOM_STRETCH_TO_FULL_SCREEN

In C STB API, fixed zoom modes are available via the following constants
(see dune_stb_api.h):
   #define DUNESTBAPI_VIDEO_ZOOM_NORMAL                            0
   #define DUNESTBAPI_VIDEO_ZOOM_ENLARGE                           1
   #define DUNESTBAPI_VIDEO_ZOOM_MAKE_WIDER                        2
   #define DUNESTBAPI_VIDEO_ZOOM_NON_LINEAR_STRETCH                3
   #define DUNESTBAPI_VIDEO_ZOOM_NON_LINEAR_STRETCH_TO_FULL_SCREEN 4
   #define DUNESTBAPI_VIDEO_ZOOM_MAKE_TALLER                       5
   #define DUNESTBAPI_VIDEO_ZOOM_CUT_EDGES                         6
   #define DUNESTBAPI_VIDEO_ZOOM_FULL_SCREEN                       8
   #define DUNESTBAPI_VIDEO_ZOOM_STRETCH_TO_FULL_SCREEN            9

In "settings.properties" file, fixed zoom mode is represented by
"zoom_preset" parameter. The value of "zoom_preset" parameter is the
numeric of the corresponding zoom mode constant in STB C API.