| // Copyright (c) 2010 The WebM project authors. All Rights Reserved. | |
| // | |
| // Use of this source code is governed by a BSD-style license | |
| // that can be found in the LICENSE file in the root of the source | |
| // tree. An additional intellectual property rights grant can be found | |
| // in the file PATENTS. All contributing project authors may | |
| // be found in the AUTHORS file in the root of the source tree. | |
| import "oaidl.idl"; | |
| import "ocidl.idl"; | |
| import "strmif.idl"; | |
| [ | |
| uuid(ED3110F4-5211-11DF-94AF-0026B977EEAA), | |
| helpstring("VP8 Encoder Filter Type Library"), | |
| version(1.0) | |
| ] | |
| library VP8EncoderLib | |
| { | |
| enum VP8Deadline | |
| { | |
| kDeadlineBestQuality = 0, | |
| kDeadlineRealtime = 1, | |
| kDeadlineGoodQuality = 1000000 | |
| }; | |
| //Keyframe placement mode | |
| // | |
| //Specifies whether keyframes are placed automatically | |
| //by the encoder, or whether this behavior is disabled. | |
| enum VP8KeyframeMode | |
| { | |
| kKeyframeModeDefault = -1, //use encoder default | |
| kKeyframeModeDisabled = 0, //encoder does not place keyframes | |
| kKeyframeModeAuto = 1 //encoder determines optimal placement | |
| }; | |
| enum VP8EndUsage | |
| { | |
| kEndUsageDefault = -1, | |
| kEndUsageVBR = 0, | |
| kEndUsageCBR = 1 | |
| }; | |
| enum VP8PassMode | |
| { | |
| kPassModeOnePass, | |
| kPassModeFirstPass, | |
| kPassModeLastPass | |
| }; | |
| [ | |
| object, | |
| uuid(ED311151-5211-11DF-94AF-0026B977EEAA), | |
| helpstring("VP8 Encoder Filter Interface") | |
| ] | |
| interface IVP8Encoder : IUnknown | |
| { | |
| //ApplySettings | |
| // | |
| //The filter maintains a set of encoder configuration values, held | |
| //in cache. Any parameters set (using the methods below) are always | |
| //applied to the cached value, irrespective of the state of the graph. | |
| // | |
| //When the graph is started, the filter initializes the VP8 encoder | |
| //using the cached configuration values. This is done automatically, | |
| //as part of the activities associated with transitioning the filter | |
| //from the stopped state. | |
| // | |
| //If the graph has been started, then any parameters set by the user | |
| //are still applied to the cache (as before). However, to apply the | |
| //configuration values in cache to the VP8 encoder, the user must also | |
| //call ApplySettings. | |
| // | |
| //It is harmless to call ApplySettings while the graph is stopped. | |
| HRESULT ApplySettings(); | |
| //ResetSettings | |
| // | |
| //Sets the configuration values in cache to their defaults, the same | |
| //as they had when the filter instance was originally created. | |
| HRESULT ResetSettings(); | |
| //Deadline | |
| // | |
| //Time to spend encoding, in microseconds. (0=infinite) | |
| HRESULT SetDeadline([in] int Deadline); | |
| HRESULT GetDeadline([out] int* pDeadline); | |
| //ThreadCount | |
| // | |
| //For multi-threaded implementations, use no more than this number of | |
| //threads. The codec may use fewer threads than allowed. The value | |
| //0 is equivalent to the value 1. | |
| HRESULT SetThreadCount([in] int Threads); | |
| HRESULT GetThreadCount([out] int* pThreads); | |
| //ErrorResilient | |
| // | |
| //Error resilient mode indicates to the encoder that it should take | |
| //measures appropriate for streaming over lossy or noisy links, if | |
| //possible. The value 0 means feature is disabled (the default), | |
| //and any positive value means the feature is enabled. | |
| HRESULT SetErrorResilient([in] int ErrorResilient); | |
| HRESULT GetErrorResilient([out] int* pErrorResilient); | |
| //Temporal resampling configuration | |
| // | |
| //Temporal resampling allows the codec to "drop" frames as a strategy to | |
| //meet its target data rate. This can cause temporal discontinuities in | |
| //the encoded video, which may appear as stuttering during playback. This | |
| //trade-off is often acceptable, but for many applications is not. It can | |
| //be disabled in these cases. | |
| // | |
| //This threshold is described as a percentage of the target data buffer. | |
| //When the data buffer falls below this percentage of fullness, a | |
| //dropped frame is indicated. Set the threshold to zero (0) to disable | |
| //this feature. | |
| HRESULT SetDropframeThreshold([in] int DropframeThreshold); | |
| HRESULT GetDropframeThreshold([out] int* pDropframeThreshold); | |
| //Enable/disable spatial resampling | |
| // | |
| //Spatial resampling allows the codec to compress a lower resolution | |
| //version of the frame, which is then upscaled by the encoder to the | |
| //correct presentation resolution. This increases visual quality at | |
| //low data rates, at the expense of CPU time on the encoder/decoder. | |
| HRESULT SetResizeAllowed([in] int ResizeAllowed); | |
| HRESULT GetResizeAllowed([out] int* pResizeAllowed); | |
| //Spatial resampling up watermark. | |
| // | |
| //This threshold is described as a percentage of the target data buffer. | |
| //When the data buffer rises above this percentage of fullness, the | |
| //encoder will step up to a higher resolution version of the frame. | |
| HRESULT SetResizeUpThreshold([in] int ResizeUpThreshold); | |
| HRESULT GetResizeUpThreshold([out] int* pResizeUpThreshold); | |
| //Spatial resampling down watermark. | |
| // | |
| //This threshold is described as a percentage of the target data buffer. | |
| //When the data buffer falls below this percentage of fullness, the | |
| //encoder will step down to a lower resolution version of the frame. | |
| HRESULT SetResizeDownThreshold([in] int ResizeDownThreshold); | |
| HRESULT GetResizeDownThreshold([out] int* pResizeDownThreshold); | |
| //EndUsage | |
| // | |
| //Indicates whether the end usage of this stream is to be streamed over | |
| //a bandwidth constrained link (kEndUsageCBR), or whether it will be | |
| //played back on a high bandwidth link, as from a local disk, where | |
| //higher variations in bitrate are acceptable (kEndUsageVBR, the default). | |
| HRESULT SetEndUsage([in] enum VP8EndUsage EndUsage); | |
| HRESULT GetEndUsage([out] enum VP8EndUsage* pEndUsage); | |
| //LagInFrames | |
| // | |
| //If set, this value allows the encoder to consume a number of input | |
| //frames before producing output frames. This allows the encoder to | |
| //base decisions for the current frame on future frames. This does | |
| //increase the latency of the encoding pipeline, so it is not appropriate | |
| //in all situations (ex: realtime encoding). | |
| // | |
| //Note that this is a maximum value -- the encoder may produce frames | |
| //sooner than the given limit. Set this value to 0 to disable this | |
| //feature. | |
| HRESULT SetLagInFrames([in] int LagInFrames); | |
| HRESULT GetLagInFrames([out] int* pLagInFrames); | |
| //VP8 token partition mode | |
| // | |
| //This defines VP8 partitioning mode for compressed data, i.e., the number | |
| //of sub-streams in the bitstream. Used for parallelized decoding. | |
| // | |
| //Value 0 = one token partition | |
| //Value 1 = two token partitions | |
| //Value 2 = four token partitions | |
| //Value 3 = eight token partitions | |
| HRESULT SetTokenPartitions([in] int TokenPartition); | |
| HRESULT GetTokenPartitions([out] int* pTokenPartition); | |
| //Target data rate | |
| // | |
| //Target bandwidth to use for this stream, in kilobits per second. | |
| //The value 0 means "use the codec default". | |
| HRESULT SetTargetBitrate([in] int Bitrate); | |
| HRESULT GetTargetBitrate([out] int* pBitrate); | |
| //Minimum (Best Quality) Quantizer | |
| // | |
| //The quantizer is the most direct control over the quality of the | |
| //encoded image. The quantizer range is [0, 63]. | |
| HRESULT SetMinQuantizer([in] int MinQuantizer); | |
| HRESULT GetMinQuantizer([out] int* pMinQuantizer); | |
| //Maximum (Worst Quality) Quantizer | |
| // | |
| //The quantizer is the most direct control over the quality of the | |
| //encoded image. The quantizer range is [0, 63]. | |
| HRESULT SetMaxQuantizer([in] int MaxQuantizer); | |
| HRESULT GetMaxQuantizer([out] int* pMaxQuantizer); | |
| //Rate control undershoot tolerance | |
| // | |
| //This value, expressed as a percentage of the target bitrate, describes | |
| //the target bitrate for easier frames, allowing bits to be saved for | |
| //harder frames. Set to zero to use the codec default. | |
| HRESULT SetUndershootPct([in] int UndershootPct); | |
| HRESULT GetUndershootPct([out] int* pUndershootPct); | |
| //Rate control overshoot tolerance | |
| // | |
| //This value, expressed as a percentage of the target bitrate, describes | |
| //the maximum allowed bitrate for a given frame. Set to zero to use the | |
| //codec default. | |
| HRESULT SetOvershootPct([in] int OvershootPct); | |
| HRESULT GetOvershootPct([out] int* pOvershootPct); | |
| //Decoder Buffer Size | |
| // | |
| //This value indicates the amount of data that may be buffered by the | |
| //decoding application. Note that this value is expressed in units of | |
| //time (milliseconds). For example, a value of 5000 indicates that the | |
| //client will buffer (at least) 5000ms worth of encoded data. | |
| HRESULT SetDecoderBufferSize([in] int TimeInMilliseconds); | |
| HRESULT GetDecoderBufferSize([out] int* pTimeInMilliseconds); | |
| //Decoder Buffer Initial Size | |
| // | |
| //This value indicates the amount of data that will be buffered by the | |
| //decoding application prior to beginning playback. This value is | |
| //expressed in units of time (milliseconds). | |
| HRESULT SetDecoderBufferInitialSize([in] int TimeInMilliseconds); | |
| HRESULT GetDecoderBufferInitialSize([out] int* pTimeInMilliseconds); | |
| //Decoder Buffer Optimal Size | |
| // | |
| //This value indicates the amount of data that the encoder should try | |
| //to maintain in the decoder's buffer. This value is expressed in units | |
| //of time (milliseconds). | |
| HRESULT SetDecoderBufferOptimalSize([in] int TimeInMilliseconds); | |
| HRESULT GetDecoderBufferOptimalSize([out] int* pTimeInMilliseconds); | |
| //Keyframe placement mode | |
| // | |
| //This value indicates whether the encoder should place keyframes at a | |
| //fixed interval, or determine the optimal placement automatically | |
| //(as governed by the KeyframeMinInterval and KeyframeMaxInterval). | |
| HRESULT SetKeyframeMode([in] enum VP8KeyframeMode Mode); | |
| HRESULT GetKeyframeMode([out] enum VP8KeyframeMode* pMode); | |
| //Keyframe minimum interval | |
| // | |
| //This value, expressed as a number of frames, prevents the encoder from | |
| //placing a keyframe nearer than MinInterval to the previous keyframe. At | |
| //least MinInterval frames non-keyframes will be coded before the next | |
| //keyframe. Set MinInterval equal to MaxInterval for a fixed interval. | |
| HRESULT SetKeyframeMinInterval([in] int MinInterval); | |
| HRESULT GetKeyframeMinInterval([out] int* pMinInterval); | |
| //Keyframe maximum interval | |
| // | |
| //This value, expressed as a number of frames, forces the encoder to code | |
| //a keyframe if one has not been coded in the last MaxInterval frames. | |
| //A value of 0 implies all frames will be keyframes. Set MinInterval | |
| //equal to MaxInterval for a fixed interval. | |
| HRESULT SetKeyframeMaxInterval([in] int MaxInterval); | |
| HRESULT GetKeyframeMaxInterval([out] int* pMaxInterval); | |
| //Multi-pass Encoding Mode | |
| // | |
| //This value should be set to the current phase for multi-pass encoding. | |
| HRESULT SetPassMode([in] enum VP8PassMode PassMode); | |
| HRESULT GetPassMode([out] enum VP8PassMode* pPassMode); | |
| //Stats Buffer | |
| // | |
| //The stats buffer is the buffer containing all of the stats packets from | |
| //the first pass, concatenated together. It is only used during the last | |
| //pass of a multi-pass (really, two-pass) mode. | |
| HRESULT SetTwoPassStatsBuf(const BYTE* Buffer, LONGLONG Length); | |
| HRESULT GetTwoPassStatsBuf(const BYTE** pBuffer, LONGLONG* pLength); | |
| //Two-pass mode CBR/VBR bias | |
| // | |
| //Bias, expressed on a scale of 0 to 100, for determining target size | |
| //for the current frame. The value 0 indicates the optimal CBR mode | |
| //value should be used. The value 100 indicates the optimal VBR mode | |
| //value should be used. Values in between indicate which way the | |
| //encoder should "lean." | |
| // | |
| //RC mode bias between CBR and VBR(0-100: 0->CBR, 100->VBR) | |
| HRESULT SetTwoPassVbrBiasPct([in] int Bias); | |
| HRESULT GetTwoPassVbrBiasPct([out] int* pBias); | |
| //Two-pass mode per-GOP minimum bitrate | |
| // | |
| //This value, expressed as a percentage of the target bitrate, indicates | |
| //the minimum bitrate to be used for a single GOP (aka "section"). | |
| HRESULT SetTwoPassVbrMinsectionPct([in] int Bitrate); | |
| HRESULT GetTwoPassVbrMinsectionPct([out] int* pBitrate); | |
| //Two-pass mode per-GOP maximum bitrate | |
| // | |
| //This value, expressed as a percentage of the target bitrate, indicates | |
| //the maximum bitrate to be used for a single GOP (aka "section"). | |
| HRESULT SetTwoPassVbrMaxsectionPct([in] int Bitrate); | |
| HRESULT GetTwoPassVbrMaxsectionPct([out] int* pBitrate); | |
| //Force Keyframe | |
| // | |
| //Set a flag to request that a keyframe be created from the next frame | |
| //encoded. When the frame is encoded, automatically clear the flag. | |
| // | |
| //If the graph is stopped, then this flag will only be applied when the | |
| //graph transitions out of stopped. You can also clear the flag manually. | |
| HRESULT SetForceKeyframe(); | |
| HRESULT ClearForceKeyframe(); | |
| //Enable/disable Auto Alt Ref | |
| // | |
| //Enable the encoder to include an alternate reference frame. | |
| // | |
| // Note set auto alt ref to 0 (default) to disable auto alt ref. | |
| HRESULT SetAutoAltRef([in] int AutoAltRef); | |
| HRESULT GetAutoAltRef([out] int* pAutoAltRef); | |
| //Alt Ref Filter Max Frames | |
| // | |
| //This is the maximum number of frames to run the temporal filter over. | |
| //The number of frames has to be less than or equal to lag in frames. | |
| // | |
| //The range is [0, 15]. Zero is the default. | |
| HRESULT SetARNRMaxFrames([in] int Frames); | |
| HRESULT GetARNRMaxFrames([out] int* pFrames); | |
| //Alt Ref Filter Strength | |
| // | |
| //This is the relative strength of the blur for the temporal filter. | |
| // | |
| //The range is [0, 6]. Zero is the weakest and six is the strongest. Three | |
| //is the default. | |
| HRESULT SetARNRStrength([in] int Strength); | |
| HRESULT GetARNRStrength([out] int* pStrength); | |
| //Alt Ref Filter Type | |
| // | |
| //This is the type of blur for the temporal filter. | |
| // | |
| //The range is [1, 3]. | |
| //Value 1 = a backward blur | |
| //Value 2 = a forward blur | |
| //Value 3 = a center blur (default) | |
| HRESULT SetARNRType([in] int Type); | |
| HRESULT GetARNRType([out] int* pType); | |
| //Fixed keyframe interval. | |
| // | |
| //If keyframe generation at a fixed interval is desired, set keyframe mode | |
| //to kKeyframeModeDisabled, and set the interval using this method. | |
| // | |
| //This is most useful when dealing with a variable frame rate video source | |
| //when a consistent keyframe interval is desired for streaming purposes. | |
| // | |
| //Return values: | |
| //- S_OK when successful. | |
| //- S_FALSE if keyframe mode has not been set kKeyframeModeDisabled. | |
| //- E_INVALIDARG for interval values less than zero. | |
| HRESULT SetFixedKeyframeInterval([in] REFERENCE_TIME Interval); | |
| HRESULT GetFixedKeyframeInterval([out] REFERENCE_TIME* pInterval); | |
| //CPU used -- encoder complexity control. | |
| // | |
| //Changes in this value influences, among others, the encoder's selection | |
| //of motion estimation methods. Values greater than 0 will increase | |
| //encoder speed at the expense of quality. See libvpx documentation of | |
| //the VP8E_SET_CPUUSED option for further information. | |
| // | |
| //Value range is [-16,16]. Values outside the range are ignored. The | |
| //default value for configuration of libvpx used within webmdshow is 0. | |
| // | |
| //Return values: | |
| //- S_OK when successful. | |
| HRESULT SetCPUUsed([in] int CPUUsed); | |
| HRESULT GetCPUUsed([out] int* pCPUUsed); | |
| //Static macroblock threshold. | |
| // | |
| //Sets the threshold for macroblocks to be treated as static by libvpx. | |
| //When active it allows the encoder to skip blocks that it deems static | |
| //based on the provided threshold. Values > 1000 not advisable, and any | |
| //value greater than 0 can cause encoding artifacts due to skipped blocks. | |
| // | |
| //Values less than 0 are ignored. | |
| // | |
| //Return values: | |
| //- S_OK when successful. | |
| HRESULT SetStaticThreshold([in] int StaticThreshold); | |
| HRESULT GetStaticThreshold([out] int* pStaticThreshold); | |
| //Decimate. | |
| // | |
| //Reduces frame rate of input video by discarding video frames based on | |
| //Decimate value. For Decimate value N, and N >= 2, the VP8 encoder filter | |
| //encodes only every Nth frame. | |
| // | |
| //Decimate values <= 1 disable decimation. | |
| // | |
| //To change the decimation setting: | |
| //- The filter graph state must be State_Stopped. | |
| //- The input pin must be connected. | |
| //- The output pin must be disconnected. | |
| // | |
| //Return values: | |
| //- S_OK when successful. | |
| //- VFW_E_NOT_STOPPED when graph is not stopped. | |
| //- VFW_E_NOT_CONNECTED when input pin is not connected. | |
| //- VFW_E_ALREADY_CONNECTED when output pin is connected. | |
| HRESULT SetDecimate([in] int Decimate); | |
| HRESULT GetDecimate([out] int* pDecimate); | |
| } | |
| [ | |
| uuid(ED3110F5-5211-11DF-94AF-0026B977EEAA), | |
| helpstring("VP8 Encoder Filter Class") | |
| ] | |
| coclass VP8Encoder | |
| { | |
| [default] interface IVP8Encoder; | |
| } | |
| } //end library VP8EncoderLib |