{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaConvert.Types.Av1Settings
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.Av1Settings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.Av1AdaptiveQuantization
import Amazonka.MediaConvert.Types.Av1FramerateControl
import Amazonka.MediaConvert.Types.Av1FramerateConversionAlgorithm
import Amazonka.MediaConvert.Types.Av1QvbrSettings
import Amazonka.MediaConvert.Types.Av1RateControlMode
import Amazonka.MediaConvert.Types.Av1SpatialAdaptiveQuantization
import qualified Amazonka.Prelude as Prelude

-- | Required when you set Codec, under VideoDescription>CodecSettings to the
-- value AV1.
--
-- /See:/ 'newAv1Settings' smart constructor.
data Av1Settings = Av1Settings'
  { -- | Specify the GOP length (keyframe interval) in frames. With AV1,
    -- MediaConvert doesn\'t support GOP length in seconds. This value must be
    -- greater than zero and preferably equal to 1 + ((numberBFrames + 1) * x),
    -- where x is an integer value.
    Av1Settings -> Maybe Double
gopSize :: Prelude.Maybe Prelude.Double,
    -- | Specify from the number of B-frames, in the range of 0-15. For AV1
    -- encoding, we recommend using 7 or 15. Choose a larger number for a lower
    -- bitrate and smaller file size; choose a smaller number for better video
    -- quality.
    Av1Settings -> Maybe Natural
numberBFramesBetweenReferenceFrames :: Prelude.Maybe Prelude.Natural,
    -- | Specify the number of slices per picture. This value must be 1, 2, 4, 8,
    -- 16, or 32. For progressive pictures, this value must be less than or
    -- equal to the number of macroblock rows. For interlaced pictures, this
    -- value must be less than or equal to half the number of macroblock rows.
    Av1Settings -> Maybe Natural
slices :: Prelude.Maybe Prelude.Natural,
    -- | \'With AV1 outputs, for rate control mode, MediaConvert supports only
    -- quality-defined variable bitrate (QVBR). You can\'\'t use CBR or VBR.\'
    Av1Settings -> Maybe Av1RateControlMode
rateControlMode :: Prelude.Maybe Av1RateControlMode,
    -- | Settings for quality-defined variable bitrate encoding with the H.265
    -- codec. Use these settings only when you set QVBR for Rate control mode
    -- (RateControlMode).
    Av1Settings -> Maybe Av1QvbrSettings
qvbrSettings :: Prelude.Maybe Av1QvbrSettings,
    -- | When you use the API for transcode jobs that use frame rate conversion,
    -- specify the frame rate as a fraction. For example, 24000 \/ 1001 =
    -- 23.976 fps. Use FramerateDenominator to specify the denominator of this
    -- fraction. In this example, use 1001 for the value of
    -- FramerateDenominator. When you use the console for transcode jobs that
    -- use frame rate conversion, provide the value as a decimal number for
    -- Framerate. In this example, specify 23.976.
    Av1Settings -> Maybe Natural
framerateDenominator :: Prelude.Maybe Prelude.Natural,
    -- | Choose the method that you want MediaConvert to use when increasing or
    -- decreasing the frame rate. We recommend using drop duplicate
    -- (DUPLICATE_DROP) for numerically simple conversions, such as 60 fps to
    -- 30 fps. For numerically complex conversions, you can use interpolate
    -- (INTERPOLATE) to avoid stutter. This results in a smooth picture, but
    -- might introduce undesirable video artifacts. For complex frame rate
    -- conversions, especially if your source video has already been converted
    -- from its original cadence, use FrameFormer (FRAMEFORMER) to do
    -- motion-compensated interpolation. FrameFormer chooses the best
    -- conversion method frame by frame. Note that using FrameFormer increases
    -- the transcoding time and incurs a significant add-on cost.
    Av1Settings -> Maybe Av1FramerateConversionAlgorithm
framerateConversionAlgorithm :: Prelude.Maybe Av1FramerateConversionAlgorithm,
    -- | If you are using the console, use the Framerate setting to specify the
    -- frame rate for this output. If you want to keep the same frame rate as
    -- the input video, choose Follow source. If you want to do frame rate
    -- conversion, choose a frame rate from the dropdown list or choose Custom.
    -- The framerates shown in the dropdown list are decimal approximations of
    -- fractions. If you choose Custom, specify your frame rate as a fraction.
    -- If you are creating your transcoding job specification as a JSON file
    -- without the console, use FramerateControl to specify which value the
    -- service uses for the frame rate for this output. Choose
    -- INITIALIZE_FROM_SOURCE if you want the service to use the frame rate
    -- from the input. Choose SPECIFIED if you want the service to use the
    -- frame rate you specify in the settings FramerateNumerator and
    -- FramerateDenominator.
    Av1Settings -> Maybe Av1FramerateControl
framerateControl :: Prelude.Maybe Av1FramerateControl,
    -- | Specify the strength of any adaptive quantization filters that you
    -- enable. The value that you choose here applies to Spatial adaptive
    -- quantization (spatialAdaptiveQuantization).
    Av1Settings -> Maybe Av1AdaptiveQuantization
adaptiveQuantization :: Prelude.Maybe Av1AdaptiveQuantization,
    -- | When you use the API for transcode jobs that use frame rate conversion,
    -- specify the frame rate as a fraction. For example, 24000 \/ 1001 =
    -- 23.976 fps. Use FramerateNumerator to specify the numerator of this
    -- fraction. In this example, use 24000 for the value of
    -- FramerateNumerator. When you use the console for transcode jobs that use
    -- frame rate conversion, provide the value as a decimal number for
    -- Framerate. In this example, specify 23.976.
    Av1Settings -> Maybe Natural
framerateNumerator :: Prelude.Maybe Prelude.Natural,
    -- | Maximum bitrate in bits\/second. For example, enter five megabits per
    -- second as 5000000. Required when Rate control mode is QVBR.
    Av1Settings -> Maybe Natural
maxBitrate :: Prelude.Maybe Prelude.Natural,
    -- | Keep the default value, Enabled (ENABLED), to adjust quantization within
    -- each frame based on spatial variation of content complexity. When you
    -- enable this feature, the encoder uses fewer bits on areas that can
    -- sustain more distortion with no noticeable visual degradation and uses
    -- more bits on areas where any small distortion will be noticeable. For
    -- example, complex textured blocks are encoded with fewer bits and smooth
    -- textured blocks are encoded with more bits. Enabling this feature will
    -- almost always improve your video quality. Note, though, that this
    -- feature doesn\'t take into account where the viewer\'s attention is
    -- likely to be. If viewers are likely to be focusing their attention on a
    -- part of the screen with a lot of complex texture, you might choose to
    -- disable this feature. Related setting: When you enable spatial adaptive
    -- quantization, set the value for Adaptive quantization
    -- (adaptiveQuantization) depending on your content. For homogeneous
    -- content, such as cartoons and video games, set it to Low. For content
    -- with a wider variety of textures, set it to High or Higher.
    Av1Settings -> Maybe Av1SpatialAdaptiveQuantization
spatialAdaptiveQuantization :: Prelude.Maybe Av1SpatialAdaptiveQuantization
  }
  deriving (Av1Settings -> Av1Settings -> Bool
(Av1Settings -> Av1Settings -> Bool)
-> (Av1Settings -> Av1Settings -> Bool) -> Eq Av1Settings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Av1Settings -> Av1Settings -> Bool
$c/= :: Av1Settings -> Av1Settings -> Bool
== :: Av1Settings -> Av1Settings -> Bool
$c== :: Av1Settings -> Av1Settings -> Bool
Prelude.Eq, ReadPrec [Av1Settings]
ReadPrec Av1Settings
Int -> ReadS Av1Settings
ReadS [Av1Settings]
(Int -> ReadS Av1Settings)
-> ReadS [Av1Settings]
-> ReadPrec Av1Settings
-> ReadPrec [Av1Settings]
-> Read Av1Settings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Av1Settings]
$creadListPrec :: ReadPrec [Av1Settings]
readPrec :: ReadPrec Av1Settings
$creadPrec :: ReadPrec Av1Settings
readList :: ReadS [Av1Settings]
$creadList :: ReadS [Av1Settings]
readsPrec :: Int -> ReadS Av1Settings
$creadsPrec :: Int -> ReadS Av1Settings
Prelude.Read, Int -> Av1Settings -> ShowS
[Av1Settings] -> ShowS
Av1Settings -> String
(Int -> Av1Settings -> ShowS)
-> (Av1Settings -> String)
-> ([Av1Settings] -> ShowS)
-> Show Av1Settings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Av1Settings] -> ShowS
$cshowList :: [Av1Settings] -> ShowS
show :: Av1Settings -> String
$cshow :: Av1Settings -> String
showsPrec :: Int -> Av1Settings -> ShowS
$cshowsPrec :: Int -> Av1Settings -> ShowS
Prelude.Show, (forall x. Av1Settings -> Rep Av1Settings x)
-> (forall x. Rep Av1Settings x -> Av1Settings)
-> Generic Av1Settings
forall x. Rep Av1Settings x -> Av1Settings
forall x. Av1Settings -> Rep Av1Settings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Av1Settings x -> Av1Settings
$cfrom :: forall x. Av1Settings -> Rep Av1Settings x
Prelude.Generic)

-- |
-- Create a value of 'Av1Settings' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'gopSize', 'av1Settings_gopSize' - Specify the GOP length (keyframe interval) in frames. With AV1,
-- MediaConvert doesn\'t support GOP length in seconds. This value must be
-- greater than zero and preferably equal to 1 + ((numberBFrames + 1) * x),
-- where x is an integer value.
--
-- 'numberBFramesBetweenReferenceFrames', 'av1Settings_numberBFramesBetweenReferenceFrames' - Specify from the number of B-frames, in the range of 0-15. For AV1
-- encoding, we recommend using 7 or 15. Choose a larger number for a lower
-- bitrate and smaller file size; choose a smaller number for better video
-- quality.
--
-- 'slices', 'av1Settings_slices' - Specify the number of slices per picture. This value must be 1, 2, 4, 8,
-- 16, or 32. For progressive pictures, this value must be less than or
-- equal to the number of macroblock rows. For interlaced pictures, this
-- value must be less than or equal to half the number of macroblock rows.
--
-- 'rateControlMode', 'av1Settings_rateControlMode' - \'With AV1 outputs, for rate control mode, MediaConvert supports only
-- quality-defined variable bitrate (QVBR). You can\'\'t use CBR or VBR.\'
--
-- 'qvbrSettings', 'av1Settings_qvbrSettings' - Settings for quality-defined variable bitrate encoding with the H.265
-- codec. Use these settings only when you set QVBR for Rate control mode
-- (RateControlMode).
--
-- 'framerateDenominator', 'av1Settings_framerateDenominator' - When you use the API for transcode jobs that use frame rate conversion,
-- specify the frame rate as a fraction. For example, 24000 \/ 1001 =
-- 23.976 fps. Use FramerateDenominator to specify the denominator of this
-- fraction. In this example, use 1001 for the value of
-- FramerateDenominator. When you use the console for transcode jobs that
-- use frame rate conversion, provide the value as a decimal number for
-- Framerate. In this example, specify 23.976.
--
-- 'framerateConversionAlgorithm', 'av1Settings_framerateConversionAlgorithm' - Choose the method that you want MediaConvert to use when increasing or
-- decreasing the frame rate. We recommend using drop duplicate
-- (DUPLICATE_DROP) for numerically simple conversions, such as 60 fps to
-- 30 fps. For numerically complex conversions, you can use interpolate
-- (INTERPOLATE) to avoid stutter. This results in a smooth picture, but
-- might introduce undesirable video artifacts. For complex frame rate
-- conversions, especially if your source video has already been converted
-- from its original cadence, use FrameFormer (FRAMEFORMER) to do
-- motion-compensated interpolation. FrameFormer chooses the best
-- conversion method frame by frame. Note that using FrameFormer increases
-- the transcoding time and incurs a significant add-on cost.
--
-- 'framerateControl', 'av1Settings_framerateControl' - If you are using the console, use the Framerate setting to specify the
-- frame rate for this output. If you want to keep the same frame rate as
-- the input video, choose Follow source. If you want to do frame rate
-- conversion, choose a frame rate from the dropdown list or choose Custom.
-- The framerates shown in the dropdown list are decimal approximations of
-- fractions. If you choose Custom, specify your frame rate as a fraction.
-- If you are creating your transcoding job specification as a JSON file
-- without the console, use FramerateControl to specify which value the
-- service uses for the frame rate for this output. Choose
-- INITIALIZE_FROM_SOURCE if you want the service to use the frame rate
-- from the input. Choose SPECIFIED if you want the service to use the
-- frame rate you specify in the settings FramerateNumerator and
-- FramerateDenominator.
--
-- 'adaptiveQuantization', 'av1Settings_adaptiveQuantization' - Specify the strength of any adaptive quantization filters that you
-- enable. The value that you choose here applies to Spatial adaptive
-- quantization (spatialAdaptiveQuantization).
--
-- 'framerateNumerator', 'av1Settings_framerateNumerator' - When you use the API for transcode jobs that use frame rate conversion,
-- specify the frame rate as a fraction. For example, 24000 \/ 1001 =
-- 23.976 fps. Use FramerateNumerator to specify the numerator of this
-- fraction. In this example, use 24000 for the value of
-- FramerateNumerator. When you use the console for transcode jobs that use
-- frame rate conversion, provide the value as a decimal number for
-- Framerate. In this example, specify 23.976.
--
-- 'maxBitrate', 'av1Settings_maxBitrate' - Maximum bitrate in bits\/second. For example, enter five megabits per
-- second as 5000000. Required when Rate control mode is QVBR.
--
-- 'spatialAdaptiveQuantization', 'av1Settings_spatialAdaptiveQuantization' - Keep the default value, Enabled (ENABLED), to adjust quantization within
-- each frame based on spatial variation of content complexity. When you
-- enable this feature, the encoder uses fewer bits on areas that can
-- sustain more distortion with no noticeable visual degradation and uses
-- more bits on areas where any small distortion will be noticeable. For
-- example, complex textured blocks are encoded with fewer bits and smooth
-- textured blocks are encoded with more bits. Enabling this feature will
-- almost always improve your video quality. Note, though, that this
-- feature doesn\'t take into account where the viewer\'s attention is
-- likely to be. If viewers are likely to be focusing their attention on a
-- part of the screen with a lot of complex texture, you might choose to
-- disable this feature. Related setting: When you enable spatial adaptive
-- quantization, set the value for Adaptive quantization
-- (adaptiveQuantization) depending on your content. For homogeneous
-- content, such as cartoons and video games, set it to Low. For content
-- with a wider variety of textures, set it to High or Higher.
newAv1Settings ::
  Av1Settings
newAv1Settings :: Av1Settings
newAv1Settings =
  Av1Settings' :: Maybe Double
-> Maybe Natural
-> Maybe Natural
-> Maybe Av1RateControlMode
-> Maybe Av1QvbrSettings
-> Maybe Natural
-> Maybe Av1FramerateConversionAlgorithm
-> Maybe Av1FramerateControl
-> Maybe Av1AdaptiveQuantization
-> Maybe Natural
-> Maybe Natural
-> Maybe Av1SpatialAdaptiveQuantization
-> Av1Settings
Av1Settings'
    { $sel:gopSize:Av1Settings' :: Maybe Double
gopSize = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:numberBFramesBetweenReferenceFrames:Av1Settings' :: Maybe Natural
numberBFramesBetweenReferenceFrames =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:slices:Av1Settings' :: Maybe Natural
slices = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:rateControlMode:Av1Settings' :: Maybe Av1RateControlMode
rateControlMode = Maybe Av1RateControlMode
forall a. Maybe a
Prelude.Nothing,
      $sel:qvbrSettings:Av1Settings' :: Maybe Av1QvbrSettings
qvbrSettings = Maybe Av1QvbrSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:framerateDenominator:Av1Settings' :: Maybe Natural
framerateDenominator = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:framerateConversionAlgorithm:Av1Settings' :: Maybe Av1FramerateConversionAlgorithm
framerateConversionAlgorithm = Maybe Av1FramerateConversionAlgorithm
forall a. Maybe a
Prelude.Nothing,
      $sel:framerateControl:Av1Settings' :: Maybe Av1FramerateControl
framerateControl = Maybe Av1FramerateControl
forall a. Maybe a
Prelude.Nothing,
      $sel:adaptiveQuantization:Av1Settings' :: Maybe Av1AdaptiveQuantization
adaptiveQuantization = Maybe Av1AdaptiveQuantization
forall a. Maybe a
Prelude.Nothing,
      $sel:framerateNumerator:Av1Settings' :: Maybe Natural
framerateNumerator = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:maxBitrate:Av1Settings' :: Maybe Natural
maxBitrate = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:spatialAdaptiveQuantization:Av1Settings' :: Maybe Av1SpatialAdaptiveQuantization
spatialAdaptiveQuantization = Maybe Av1SpatialAdaptiveQuantization
forall a. Maybe a
Prelude.Nothing
    }

-- | Specify the GOP length (keyframe interval) in frames. With AV1,
-- MediaConvert doesn\'t support GOP length in seconds. This value must be
-- greater than zero and preferably equal to 1 + ((numberBFrames + 1) * x),
-- where x is an integer value.
av1Settings_gopSize :: Lens.Lens' Av1Settings (Prelude.Maybe Prelude.Double)
av1Settings_gopSize :: (Maybe Double -> f (Maybe Double)) -> Av1Settings -> f Av1Settings
av1Settings_gopSize = (Av1Settings -> Maybe Double)
-> (Av1Settings -> Maybe Double -> Av1Settings)
-> Lens Av1Settings Av1Settings (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Double
gopSize :: Maybe Double
$sel:gopSize:Av1Settings' :: Av1Settings -> Maybe Double
gopSize} -> Maybe Double
gopSize) (\s :: Av1Settings
s@Av1Settings' {} Maybe Double
a -> Av1Settings
s {$sel:gopSize:Av1Settings' :: Maybe Double
gopSize = Maybe Double
a} :: Av1Settings)

-- | Specify from the number of B-frames, in the range of 0-15. For AV1
-- encoding, we recommend using 7 or 15. Choose a larger number for a lower
-- bitrate and smaller file size; choose a smaller number for better video
-- quality.
av1Settings_numberBFramesBetweenReferenceFrames :: Lens.Lens' Av1Settings (Prelude.Maybe Prelude.Natural)
av1Settings_numberBFramesBetweenReferenceFrames :: (Maybe Natural -> f (Maybe Natural))
-> Av1Settings -> f Av1Settings
av1Settings_numberBFramesBetweenReferenceFrames = (Av1Settings -> Maybe Natural)
-> (Av1Settings -> Maybe Natural -> Av1Settings)
-> Lens Av1Settings Av1Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Natural
numberBFramesBetweenReferenceFrames :: Maybe Natural
$sel:numberBFramesBetweenReferenceFrames:Av1Settings' :: Av1Settings -> Maybe Natural
numberBFramesBetweenReferenceFrames} -> Maybe Natural
numberBFramesBetweenReferenceFrames) (\s :: Av1Settings
s@Av1Settings' {} Maybe Natural
a -> Av1Settings
s {$sel:numberBFramesBetweenReferenceFrames:Av1Settings' :: Maybe Natural
numberBFramesBetweenReferenceFrames = Maybe Natural
a} :: Av1Settings)

-- | Specify the number of slices per picture. This value must be 1, 2, 4, 8,
-- 16, or 32. For progressive pictures, this value must be less than or
-- equal to the number of macroblock rows. For interlaced pictures, this
-- value must be less than or equal to half the number of macroblock rows.
av1Settings_slices :: Lens.Lens' Av1Settings (Prelude.Maybe Prelude.Natural)
av1Settings_slices :: (Maybe Natural -> f (Maybe Natural))
-> Av1Settings -> f Av1Settings
av1Settings_slices = (Av1Settings -> Maybe Natural)
-> (Av1Settings -> Maybe Natural -> Av1Settings)
-> Lens Av1Settings Av1Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Natural
slices :: Maybe Natural
$sel:slices:Av1Settings' :: Av1Settings -> Maybe Natural
slices} -> Maybe Natural
slices) (\s :: Av1Settings
s@Av1Settings' {} Maybe Natural
a -> Av1Settings
s {$sel:slices:Av1Settings' :: Maybe Natural
slices = Maybe Natural
a} :: Av1Settings)

-- | \'With AV1 outputs, for rate control mode, MediaConvert supports only
-- quality-defined variable bitrate (QVBR). You can\'\'t use CBR or VBR.\'
av1Settings_rateControlMode :: Lens.Lens' Av1Settings (Prelude.Maybe Av1RateControlMode)
av1Settings_rateControlMode :: (Maybe Av1RateControlMode -> f (Maybe Av1RateControlMode))
-> Av1Settings -> f Av1Settings
av1Settings_rateControlMode = (Av1Settings -> Maybe Av1RateControlMode)
-> (Av1Settings -> Maybe Av1RateControlMode -> Av1Settings)
-> Lens
     Av1Settings
     Av1Settings
     (Maybe Av1RateControlMode)
     (Maybe Av1RateControlMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Av1RateControlMode
rateControlMode :: Maybe Av1RateControlMode
$sel:rateControlMode:Av1Settings' :: Av1Settings -> Maybe Av1RateControlMode
rateControlMode} -> Maybe Av1RateControlMode
rateControlMode) (\s :: Av1Settings
s@Av1Settings' {} Maybe Av1RateControlMode
a -> Av1Settings
s {$sel:rateControlMode:Av1Settings' :: Maybe Av1RateControlMode
rateControlMode = Maybe Av1RateControlMode
a} :: Av1Settings)

-- | Settings for quality-defined variable bitrate encoding with the H.265
-- codec. Use these settings only when you set QVBR for Rate control mode
-- (RateControlMode).
av1Settings_qvbrSettings :: Lens.Lens' Av1Settings (Prelude.Maybe Av1QvbrSettings)
av1Settings_qvbrSettings :: (Maybe Av1QvbrSettings -> f (Maybe Av1QvbrSettings))
-> Av1Settings -> f Av1Settings
av1Settings_qvbrSettings = (Av1Settings -> Maybe Av1QvbrSettings)
-> (Av1Settings -> Maybe Av1QvbrSettings -> Av1Settings)
-> Lens
     Av1Settings
     Av1Settings
     (Maybe Av1QvbrSettings)
     (Maybe Av1QvbrSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Av1QvbrSettings
qvbrSettings :: Maybe Av1QvbrSettings
$sel:qvbrSettings:Av1Settings' :: Av1Settings -> Maybe Av1QvbrSettings
qvbrSettings} -> Maybe Av1QvbrSettings
qvbrSettings) (\s :: Av1Settings
s@Av1Settings' {} Maybe Av1QvbrSettings
a -> Av1Settings
s {$sel:qvbrSettings:Av1Settings' :: Maybe Av1QvbrSettings
qvbrSettings = Maybe Av1QvbrSettings
a} :: Av1Settings)

-- | When you use the API for transcode jobs that use frame rate conversion,
-- specify the frame rate as a fraction. For example, 24000 \/ 1001 =
-- 23.976 fps. Use FramerateDenominator to specify the denominator of this
-- fraction. In this example, use 1001 for the value of
-- FramerateDenominator. When you use the console for transcode jobs that
-- use frame rate conversion, provide the value as a decimal number for
-- Framerate. In this example, specify 23.976.
av1Settings_framerateDenominator :: Lens.Lens' Av1Settings (Prelude.Maybe Prelude.Natural)
av1Settings_framerateDenominator :: (Maybe Natural -> f (Maybe Natural))
-> Av1Settings -> f Av1Settings
av1Settings_framerateDenominator = (Av1Settings -> Maybe Natural)
-> (Av1Settings -> Maybe Natural -> Av1Settings)
-> Lens Av1Settings Av1Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Natural
framerateDenominator :: Maybe Natural
$sel:framerateDenominator:Av1Settings' :: Av1Settings -> Maybe Natural
framerateDenominator} -> Maybe Natural
framerateDenominator) (\s :: Av1Settings
s@Av1Settings' {} Maybe Natural
a -> Av1Settings
s {$sel:framerateDenominator:Av1Settings' :: Maybe Natural
framerateDenominator = Maybe Natural
a} :: Av1Settings)

-- | Choose the method that you want MediaConvert to use when increasing or
-- decreasing the frame rate. We recommend using drop duplicate
-- (DUPLICATE_DROP) for numerically simple conversions, such as 60 fps to
-- 30 fps. For numerically complex conversions, you can use interpolate
-- (INTERPOLATE) to avoid stutter. This results in a smooth picture, but
-- might introduce undesirable video artifacts. For complex frame rate
-- conversions, especially if your source video has already been converted
-- from its original cadence, use FrameFormer (FRAMEFORMER) to do
-- motion-compensated interpolation. FrameFormer chooses the best
-- conversion method frame by frame. Note that using FrameFormer increases
-- the transcoding time and incurs a significant add-on cost.
av1Settings_framerateConversionAlgorithm :: Lens.Lens' Av1Settings (Prelude.Maybe Av1FramerateConversionAlgorithm)
av1Settings_framerateConversionAlgorithm :: (Maybe Av1FramerateConversionAlgorithm
 -> f (Maybe Av1FramerateConversionAlgorithm))
-> Av1Settings -> f Av1Settings
av1Settings_framerateConversionAlgorithm = (Av1Settings -> Maybe Av1FramerateConversionAlgorithm)
-> (Av1Settings
    -> Maybe Av1FramerateConversionAlgorithm -> Av1Settings)
-> Lens
     Av1Settings
     Av1Settings
     (Maybe Av1FramerateConversionAlgorithm)
     (Maybe Av1FramerateConversionAlgorithm)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Av1FramerateConversionAlgorithm
framerateConversionAlgorithm :: Maybe Av1FramerateConversionAlgorithm
$sel:framerateConversionAlgorithm:Av1Settings' :: Av1Settings -> Maybe Av1FramerateConversionAlgorithm
framerateConversionAlgorithm} -> Maybe Av1FramerateConversionAlgorithm
framerateConversionAlgorithm) (\s :: Av1Settings
s@Av1Settings' {} Maybe Av1FramerateConversionAlgorithm
a -> Av1Settings
s {$sel:framerateConversionAlgorithm:Av1Settings' :: Maybe Av1FramerateConversionAlgorithm
framerateConversionAlgorithm = Maybe Av1FramerateConversionAlgorithm
a} :: Av1Settings)

-- | If you are using the console, use the Framerate setting to specify the
-- frame rate for this output. If you want to keep the same frame rate as
-- the input video, choose Follow source. If you want to do frame rate
-- conversion, choose a frame rate from the dropdown list or choose Custom.
-- The framerates shown in the dropdown list are decimal approximations of
-- fractions. If you choose Custom, specify your frame rate as a fraction.
-- If you are creating your transcoding job specification as a JSON file
-- without the console, use FramerateControl to specify which value the
-- service uses for the frame rate for this output. Choose
-- INITIALIZE_FROM_SOURCE if you want the service to use the frame rate
-- from the input. Choose SPECIFIED if you want the service to use the
-- frame rate you specify in the settings FramerateNumerator and
-- FramerateDenominator.
av1Settings_framerateControl :: Lens.Lens' Av1Settings (Prelude.Maybe Av1FramerateControl)
av1Settings_framerateControl :: (Maybe Av1FramerateControl -> f (Maybe Av1FramerateControl))
-> Av1Settings -> f Av1Settings
av1Settings_framerateControl = (Av1Settings -> Maybe Av1FramerateControl)
-> (Av1Settings -> Maybe Av1FramerateControl -> Av1Settings)
-> Lens
     Av1Settings
     Av1Settings
     (Maybe Av1FramerateControl)
     (Maybe Av1FramerateControl)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Av1FramerateControl
framerateControl :: Maybe Av1FramerateControl
$sel:framerateControl:Av1Settings' :: Av1Settings -> Maybe Av1FramerateControl
framerateControl} -> Maybe Av1FramerateControl
framerateControl) (\s :: Av1Settings
s@Av1Settings' {} Maybe Av1FramerateControl
a -> Av1Settings
s {$sel:framerateControl:Av1Settings' :: Maybe Av1FramerateControl
framerateControl = Maybe Av1FramerateControl
a} :: Av1Settings)

-- | Specify the strength of any adaptive quantization filters that you
-- enable. The value that you choose here applies to Spatial adaptive
-- quantization (spatialAdaptiveQuantization).
av1Settings_adaptiveQuantization :: Lens.Lens' Av1Settings (Prelude.Maybe Av1AdaptiveQuantization)
av1Settings_adaptiveQuantization :: (Maybe Av1AdaptiveQuantization
 -> f (Maybe Av1AdaptiveQuantization))
-> Av1Settings -> f Av1Settings
av1Settings_adaptiveQuantization = (Av1Settings -> Maybe Av1AdaptiveQuantization)
-> (Av1Settings -> Maybe Av1AdaptiveQuantization -> Av1Settings)
-> Lens
     Av1Settings
     Av1Settings
     (Maybe Av1AdaptiveQuantization)
     (Maybe Av1AdaptiveQuantization)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Av1AdaptiveQuantization
adaptiveQuantization :: Maybe Av1AdaptiveQuantization
$sel:adaptiveQuantization:Av1Settings' :: Av1Settings -> Maybe Av1AdaptiveQuantization
adaptiveQuantization} -> Maybe Av1AdaptiveQuantization
adaptiveQuantization) (\s :: Av1Settings
s@Av1Settings' {} Maybe Av1AdaptiveQuantization
a -> Av1Settings
s {$sel:adaptiveQuantization:Av1Settings' :: Maybe Av1AdaptiveQuantization
adaptiveQuantization = Maybe Av1AdaptiveQuantization
a} :: Av1Settings)

-- | When you use the API for transcode jobs that use frame rate conversion,
-- specify the frame rate as a fraction. For example, 24000 \/ 1001 =
-- 23.976 fps. Use FramerateNumerator to specify the numerator of this
-- fraction. In this example, use 24000 for the value of
-- FramerateNumerator. When you use the console for transcode jobs that use
-- frame rate conversion, provide the value as a decimal number for
-- Framerate. In this example, specify 23.976.
av1Settings_framerateNumerator :: Lens.Lens' Av1Settings (Prelude.Maybe Prelude.Natural)
av1Settings_framerateNumerator :: (Maybe Natural -> f (Maybe Natural))
-> Av1Settings -> f Av1Settings
av1Settings_framerateNumerator = (Av1Settings -> Maybe Natural)
-> (Av1Settings -> Maybe Natural -> Av1Settings)
-> Lens Av1Settings Av1Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Natural
framerateNumerator :: Maybe Natural
$sel:framerateNumerator:Av1Settings' :: Av1Settings -> Maybe Natural
framerateNumerator} -> Maybe Natural
framerateNumerator) (\s :: Av1Settings
s@Av1Settings' {} Maybe Natural
a -> Av1Settings
s {$sel:framerateNumerator:Av1Settings' :: Maybe Natural
framerateNumerator = Maybe Natural
a} :: Av1Settings)

-- | Maximum bitrate in bits\/second. For example, enter five megabits per
-- second as 5000000. Required when Rate control mode is QVBR.
av1Settings_maxBitrate :: Lens.Lens' Av1Settings (Prelude.Maybe Prelude.Natural)
av1Settings_maxBitrate :: (Maybe Natural -> f (Maybe Natural))
-> Av1Settings -> f Av1Settings
av1Settings_maxBitrate = (Av1Settings -> Maybe Natural)
-> (Av1Settings -> Maybe Natural -> Av1Settings)
-> Lens Av1Settings Av1Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Natural
maxBitrate :: Maybe Natural
$sel:maxBitrate:Av1Settings' :: Av1Settings -> Maybe Natural
maxBitrate} -> Maybe Natural
maxBitrate) (\s :: Av1Settings
s@Av1Settings' {} Maybe Natural
a -> Av1Settings
s {$sel:maxBitrate:Av1Settings' :: Maybe Natural
maxBitrate = Maybe Natural
a} :: Av1Settings)

-- | Keep the default value, Enabled (ENABLED), to adjust quantization within
-- each frame based on spatial variation of content complexity. When you
-- enable this feature, the encoder uses fewer bits on areas that can
-- sustain more distortion with no noticeable visual degradation and uses
-- more bits on areas where any small distortion will be noticeable. For
-- example, complex textured blocks are encoded with fewer bits and smooth
-- textured blocks are encoded with more bits. Enabling this feature will
-- almost always improve your video quality. Note, though, that this
-- feature doesn\'t take into account where the viewer\'s attention is
-- likely to be. If viewers are likely to be focusing their attention on a
-- part of the screen with a lot of complex texture, you might choose to
-- disable this feature. Related setting: When you enable spatial adaptive
-- quantization, set the value for Adaptive quantization
-- (adaptiveQuantization) depending on your content. For homogeneous
-- content, such as cartoons and video games, set it to Low. For content
-- with a wider variety of textures, set it to High or Higher.
av1Settings_spatialAdaptiveQuantization :: Lens.Lens' Av1Settings (Prelude.Maybe Av1SpatialAdaptiveQuantization)
av1Settings_spatialAdaptiveQuantization :: (Maybe Av1SpatialAdaptiveQuantization
 -> f (Maybe Av1SpatialAdaptiveQuantization))
-> Av1Settings -> f Av1Settings
av1Settings_spatialAdaptiveQuantization = (Av1Settings -> Maybe Av1SpatialAdaptiveQuantization)
-> (Av1Settings
    -> Maybe Av1SpatialAdaptiveQuantization -> Av1Settings)
-> Lens
     Av1Settings
     Av1Settings
     (Maybe Av1SpatialAdaptiveQuantization)
     (Maybe Av1SpatialAdaptiveQuantization)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Av1Settings' {Maybe Av1SpatialAdaptiveQuantization
spatialAdaptiveQuantization :: Maybe Av1SpatialAdaptiveQuantization
$sel:spatialAdaptiveQuantization:Av1Settings' :: Av1Settings -> Maybe Av1SpatialAdaptiveQuantization
spatialAdaptiveQuantization} -> Maybe Av1SpatialAdaptiveQuantization
spatialAdaptiveQuantization) (\s :: Av1Settings
s@Av1Settings' {} Maybe Av1SpatialAdaptiveQuantization
a -> Av1Settings
s {$sel:spatialAdaptiveQuantization:Av1Settings' :: Maybe Av1SpatialAdaptiveQuantization
spatialAdaptiveQuantization = Maybe Av1SpatialAdaptiveQuantization
a} :: Av1Settings)

instance Core.FromJSON Av1Settings where
  parseJSON :: Value -> Parser Av1Settings
parseJSON =
    String
-> (Object -> Parser Av1Settings) -> Value -> Parser Av1Settings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Av1Settings"
      ( \Object
x ->
          Maybe Double
-> Maybe Natural
-> Maybe Natural
-> Maybe Av1RateControlMode
-> Maybe Av1QvbrSettings
-> Maybe Natural
-> Maybe Av1FramerateConversionAlgorithm
-> Maybe Av1FramerateControl
-> Maybe Av1AdaptiveQuantization
-> Maybe Natural
-> Maybe Natural
-> Maybe Av1SpatialAdaptiveQuantization
-> Av1Settings
Av1Settings'
            (Maybe Double
 -> Maybe Natural
 -> Maybe Natural
 -> Maybe Av1RateControlMode
 -> Maybe Av1QvbrSettings
 -> Maybe Natural
 -> Maybe Av1FramerateConversionAlgorithm
 -> Maybe Av1FramerateControl
 -> Maybe Av1AdaptiveQuantization
 -> Maybe Natural
 -> Maybe Natural
 -> Maybe Av1SpatialAdaptiveQuantization
 -> Av1Settings)
-> Parser (Maybe Double)
-> Parser
     (Maybe Natural
      -> Maybe Natural
      -> Maybe Av1RateControlMode
      -> Maybe Av1QvbrSettings
      -> Maybe Natural
      -> Maybe Av1FramerateConversionAlgorithm
      -> Maybe Av1FramerateControl
      -> Maybe Av1AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Av1SpatialAdaptiveQuantization
      -> Av1Settings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"gopSize")
            Parser
  (Maybe Natural
   -> Maybe Natural
   -> Maybe Av1RateControlMode
   -> Maybe Av1QvbrSettings
   -> Maybe Natural
   -> Maybe Av1FramerateConversionAlgorithm
   -> Maybe Av1FramerateControl
   -> Maybe Av1AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Av1SpatialAdaptiveQuantization
   -> Av1Settings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Natural
      -> Maybe Av1RateControlMode
      -> Maybe Av1QvbrSettings
      -> Maybe Natural
      -> Maybe Av1FramerateConversionAlgorithm
      -> Maybe Av1FramerateControl
      -> Maybe Av1AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Av1SpatialAdaptiveQuantization
      -> Av1Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"numberBFramesBetweenReferenceFrames")
            Parser
  (Maybe Natural
   -> Maybe Av1RateControlMode
   -> Maybe Av1QvbrSettings
   -> Maybe Natural
   -> Maybe Av1FramerateConversionAlgorithm
   -> Maybe Av1FramerateControl
   -> Maybe Av1AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Av1SpatialAdaptiveQuantization
   -> Av1Settings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Av1RateControlMode
      -> Maybe Av1QvbrSettings
      -> Maybe Natural
      -> Maybe Av1FramerateConversionAlgorithm
      -> Maybe Av1FramerateControl
      -> Maybe Av1AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Av1SpatialAdaptiveQuantization
      -> Av1Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"slices")
            Parser
  (Maybe Av1RateControlMode
   -> Maybe Av1QvbrSettings
   -> Maybe Natural
   -> Maybe Av1FramerateConversionAlgorithm
   -> Maybe Av1FramerateControl
   -> Maybe Av1AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Av1SpatialAdaptiveQuantization
   -> Av1Settings)
-> Parser (Maybe Av1RateControlMode)
-> Parser
     (Maybe Av1QvbrSettings
      -> Maybe Natural
      -> Maybe Av1FramerateConversionAlgorithm
      -> Maybe Av1FramerateControl
      -> Maybe Av1AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Av1SpatialAdaptiveQuantization
      -> Av1Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Av1RateControlMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"rateControlMode")
            Parser
  (Maybe Av1QvbrSettings
   -> Maybe Natural
   -> Maybe Av1FramerateConversionAlgorithm
   -> Maybe Av1FramerateControl
   -> Maybe Av1AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Av1SpatialAdaptiveQuantization
   -> Av1Settings)
-> Parser (Maybe Av1QvbrSettings)
-> Parser
     (Maybe Natural
      -> Maybe Av1FramerateConversionAlgorithm
      -> Maybe Av1FramerateControl
      -> Maybe Av1AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Av1SpatialAdaptiveQuantization
      -> Av1Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Av1QvbrSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"qvbrSettings")
            Parser
  (Maybe Natural
   -> Maybe Av1FramerateConversionAlgorithm
   -> Maybe Av1FramerateControl
   -> Maybe Av1AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Av1SpatialAdaptiveQuantization
   -> Av1Settings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Av1FramerateConversionAlgorithm
      -> Maybe Av1FramerateControl
      -> Maybe Av1AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Av1SpatialAdaptiveQuantization
      -> Av1Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"framerateDenominator")
            Parser
  (Maybe Av1FramerateConversionAlgorithm
   -> Maybe Av1FramerateControl
   -> Maybe Av1AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Av1SpatialAdaptiveQuantization
   -> Av1Settings)
-> Parser (Maybe Av1FramerateConversionAlgorithm)
-> Parser
     (Maybe Av1FramerateControl
      -> Maybe Av1AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Av1SpatialAdaptiveQuantization
      -> Av1Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Av1FramerateConversionAlgorithm)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"framerateConversionAlgorithm")
            Parser
  (Maybe Av1FramerateControl
   -> Maybe Av1AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Av1SpatialAdaptiveQuantization
   -> Av1Settings)
-> Parser (Maybe Av1FramerateControl)
-> Parser
     (Maybe Av1AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Av1SpatialAdaptiveQuantization
      -> Av1Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Av1FramerateControl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"framerateControl")
            Parser
  (Maybe Av1AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Av1SpatialAdaptiveQuantization
   -> Av1Settings)
-> Parser (Maybe Av1AdaptiveQuantization)
-> Parser
     (Maybe Natural
      -> Maybe Natural
      -> Maybe Av1SpatialAdaptiveQuantization
      -> Av1Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Av1AdaptiveQuantization)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"adaptiveQuantization")
            Parser
  (Maybe Natural
   -> Maybe Natural
   -> Maybe Av1SpatialAdaptiveQuantization
   -> Av1Settings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Natural
      -> Maybe Av1SpatialAdaptiveQuantization -> Av1Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"framerateNumerator")
            Parser
  (Maybe Natural
   -> Maybe Av1SpatialAdaptiveQuantization -> Av1Settings)
-> Parser (Maybe Natural)
-> Parser (Maybe Av1SpatialAdaptiveQuantization -> Av1Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maxBitrate")
            Parser (Maybe Av1SpatialAdaptiveQuantization -> Av1Settings)
-> Parser (Maybe Av1SpatialAdaptiveQuantization)
-> Parser Av1Settings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Av1SpatialAdaptiveQuantization)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"spatialAdaptiveQuantization")
      )

instance Prelude.Hashable Av1Settings

instance Prelude.NFData Av1Settings

instance Core.ToJSON Av1Settings where
  toJSON :: Av1Settings -> Value
toJSON Av1Settings' {Maybe Double
Maybe Natural
Maybe Av1AdaptiveQuantization
Maybe Av1FramerateControl
Maybe Av1FramerateConversionAlgorithm
Maybe Av1QvbrSettings
Maybe Av1RateControlMode
Maybe Av1SpatialAdaptiveQuantization
spatialAdaptiveQuantization :: Maybe Av1SpatialAdaptiveQuantization
maxBitrate :: Maybe Natural
framerateNumerator :: Maybe Natural
adaptiveQuantization :: Maybe Av1AdaptiveQuantization
framerateControl :: Maybe Av1FramerateControl
framerateConversionAlgorithm :: Maybe Av1FramerateConversionAlgorithm
framerateDenominator :: Maybe Natural
qvbrSettings :: Maybe Av1QvbrSettings
rateControlMode :: Maybe Av1RateControlMode
slices :: Maybe Natural
numberBFramesBetweenReferenceFrames :: Maybe Natural
gopSize :: Maybe Double
$sel:spatialAdaptiveQuantization:Av1Settings' :: Av1Settings -> Maybe Av1SpatialAdaptiveQuantization
$sel:maxBitrate:Av1Settings' :: Av1Settings -> Maybe Natural
$sel:framerateNumerator:Av1Settings' :: Av1Settings -> Maybe Natural
$sel:adaptiveQuantization:Av1Settings' :: Av1Settings -> Maybe Av1AdaptiveQuantization
$sel:framerateControl:Av1Settings' :: Av1Settings -> Maybe Av1FramerateControl
$sel:framerateConversionAlgorithm:Av1Settings' :: Av1Settings -> Maybe Av1FramerateConversionAlgorithm
$sel:framerateDenominator:Av1Settings' :: Av1Settings -> Maybe Natural
$sel:qvbrSettings:Av1Settings' :: Av1Settings -> Maybe Av1QvbrSettings
$sel:rateControlMode:Av1Settings' :: Av1Settings -> Maybe Av1RateControlMode
$sel:slices:Av1Settings' :: Av1Settings -> Maybe Natural
$sel:numberBFramesBetweenReferenceFrames:Av1Settings' :: Av1Settings -> Maybe Natural
$sel:gopSize:Av1Settings' :: Av1Settings -> Maybe Double
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"gopSize" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
gopSize,
            (Text
"numberBFramesBetweenReferenceFrames" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
numberBFramesBetweenReferenceFrames,
            (Text
"slices" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
slices,
            (Text
"rateControlMode" Text -> Av1RateControlMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Av1RateControlMode -> Pair)
-> Maybe Av1RateControlMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Av1RateControlMode
rateControlMode,
            (Text
"qvbrSettings" Text -> Av1QvbrSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Av1QvbrSettings -> Pair) -> Maybe Av1QvbrSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Av1QvbrSettings
qvbrSettings,
            (Text
"framerateDenominator" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
framerateDenominator,
            (Text
"framerateConversionAlgorithm" Text -> Av1FramerateConversionAlgorithm -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Av1FramerateConversionAlgorithm -> Pair)
-> Maybe Av1FramerateConversionAlgorithm -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Av1FramerateConversionAlgorithm
framerateConversionAlgorithm,
            (Text
"framerateControl" Text -> Av1FramerateControl -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Av1FramerateControl -> Pair)
-> Maybe Av1FramerateControl -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Av1FramerateControl
framerateControl,
            (Text
"adaptiveQuantization" Text -> Av1AdaptiveQuantization -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Av1AdaptiveQuantization -> Pair)
-> Maybe Av1AdaptiveQuantization -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Av1AdaptiveQuantization
adaptiveQuantization,
            (Text
"framerateNumerator" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
framerateNumerator,
            (Text
"maxBitrate" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxBitrate,
            (Text
"spatialAdaptiveQuantization" Text -> Av1SpatialAdaptiveQuantization -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Av1SpatialAdaptiveQuantization -> Pair)
-> Maybe Av1SpatialAdaptiveQuantization -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Av1SpatialAdaptiveQuantization
spatialAdaptiveQuantization
          ]
      )