webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Functions | Variables
plot_webrtc_test_logs Namespace Reference

Functions

def ParseSetting (filename, setting)
 
def ParseMetrics (filename, setting1, setting2)
 
def TryFindMetric (parsed, line, f)
 
def GetMetric (name, string)
 
def StringToFloat (value)
 
def Plot (y_metric, x_metric, metrics)
 
def PlotFigure (settings, y_metrics, x_metric, metrics, title)
 
def GetTitle (filename)
 
def ToString (input_list)
 
def ToStringWithoutMetric (input_list, metric)
 
def GetIdx (text_list)
 
def main ()
 

Variables

string EVENT_START = 'RUN ] CodecSettings/PlotVideoProcessorIntegrationTest.'
 
string EVENT_END = 'OK ] CodecSettings/PlotVideoProcessorIntegrationTest.'
 
tuple BITRATE = ('Target Bitrate', 'bitrate (kbps)')
 
tuple WIDTH = ('Width', 'width')
 
tuple HEIGHT = ('Height', 'height')
 
tuple FILENAME = ('Filename', 'clip')
 
tuple CODEC_TYPE = ('Codec type', 'Codec')
 
tuple ENCODER_IMPLEMENTATION_NAME = ('Encoder implementation name', 'enc name')
 
tuple DECODER_IMPLEMENTATION_NAME = ('Decoder implementation name', 'dec name')
 
tuple NUM_FRAMES = ('Total # of frames', 'num frames')
 
tuple CORES = ('#CPU cores used', 'CPU cores used')
 
tuple DENOISING = ('Denoising', 'denoising')
 
tuple RESILIENCE = ('Resilience', 'resilience')
 
tuple ERROR_CONCEALMENT = ('Error concealment', 'error concealment')
 
tuple QP = ('Average QP', 'avg QP')
 
tuple PSNR = ('PSNR avg', 'PSNR (dB)')
 
tuple SSIM = ('SSIM avg', 'SSIM')
 
tuple ENC_BITRATE = ('Encoding bitrate', 'encoded bitrate (kbps)')
 
tuple FRAMERATE = ('Frame rate', 'fps')
 
tuple NUM_DROPPED_FRAMES = ('Number of dropped frames', 'num dropped frames')
 
tuple NUM_FRAMES_TO_TARGET
 
tuple ENCODE_TIME = ('Encoding time', 'encode time (us)')
 
tuple ENCODE_TIME_AVG = ('Encoding time', 'encode time (us) avg')
 
tuple DECODE_TIME = ('Decoding time', 'decode time (us)')
 
tuple DECODE_TIME_AVG = ('Decoding time', 'decode time (us) avg')
 
tuple FRAME_SIZE = ('Frame sizes', 'frame size (bytes)')
 
tuple FRAME_SIZE_AVG = ('Frame sizes', 'frame size (bytes) avg')
 
tuple AVG_KEY_FRAME_SIZE = ('Average key frame size', 'avg key frame size (bytes)')
 
tuple AVG_NON_KEY_FRAME_SIZE
 
list SETTINGS
 
list X_SETTINGS
 
list SUBPLOT_SETTINGS
 
list RESULTS
 
list METRICS_TO_PARSE = SETTINGS + SUBPLOT_SETTINGS + RESULTS
 
list Y_METRICS = [res[1] for res in RESULTS]
 
int FIG_SIZE_SCALE_FACTOR_X = 2
 
float FIG_SIZE_SCALE_FACTOR_Y = 2.8
 
list GRID_COLOR = [0.45, 0.45, 0.45]
 

Function Documentation

◆ GetIdx()

def plot_webrtc_test_logs.GetIdx (   text_list)

◆ GetMetric()

def plot_webrtc_test_logs.GetMetric (   name,
  string 
)

◆ GetTitle()

def plot_webrtc_test_logs.GetTitle (   filename)

◆ main()

def plot_webrtc_test_logs.main ( void  )

◆ ParseMetrics()

def plot_webrtc_test_logs.ParseMetrics (   filename,
  setting1,
  setting2 
)
Parses metrics from file.

Args:
  filename: The name of the file.
  setting1: First setting for sorting metrics (e.g. width).
  setting2: Second setting for sorting metrics (e.g. CPU cores used).

Returns:
  A dictionary holding parsed metrics.

For example:
  metrics[key1][key2][measurement]

metrics = {
"width: 352": {
  "CPU cores used: 1.0": {
    "encode time (us)": [0.718005, 0.806925, 0.909726, 0.931835, 0.953642],
    "PSNR (dB)": [25.546029, 29.465518, 34.723535, 36.428493, 38.686551],
    "bitrate (kbps)": [50, 100, 300, 500, 1000]
  },
  "CPU cores used: 2.0": {
    "encode time (us)": [0.718005, 0.806925, 0.909726, 0.931835, 0.953642],
    "PSNR (dB)": [25.546029, 29.465518, 34.723535, 36.428493, 38.686551],
    "bitrate (kbps)": [50, 100, 300, 500, 1000]
  },
},
"width: 176": {
  "CPU cores used: 1.0": {
    "encode time (us)": [0.857897, 0.91608, 0.959173, 0.971116, 0.980961],
    "PSNR (dB)": [30.243646, 33.375592, 37.574387, 39.42184, 41.437897],
    "bitrate (kbps)": [50, 100, 300, 500, 1000]
  },
}
} 

◆ ParseSetting()

def plot_webrtc_test_logs.ParseSetting (   filename,
  setting 
)
Parses setting from file.

Args:
  filename: The name of the file.
  setting: Name of setting to parse (e.g. width).

Returns:
  A list holding parsed settings, e.g. ['width: 128.0', 'width: 160.0'] 

◆ Plot()

def plot_webrtc_test_logs.Plot (   y_metric,
  x_metric,
  metrics 
)
Plots y_metric vs x_metric per key in metrics.

For example:
  y_metric = 'PSNR (dB)'
  x_metric = 'bitrate (kbps)'
  metrics = {
    "CPU cores used: 1.0": {
      "PSNR (dB)": [25.546029, 29.465518, 34.723535, 36.428493, 38.686551],
      "bitrate (kbps)": [50, 100, 300, 500, 1000]
    },
    "CPU cores used: 2.0": {
      "PSNR (dB)": [25.546029, 29.465518, 34.723535, 36.428493, 38.686551],
      "bitrate (kbps)": [50, 100, 300, 500, 1000]
    },
  }

◆ PlotFigure()

def plot_webrtc_test_logs.PlotFigure (   settings,
  y_metrics,
  x_metric,
  metrics,
  title 
)
Plots metrics in y_metrics list. One figure is plotted and each entry
in the list is plotted in a subplot (and sorted per settings).

For example:
  settings = ['width: 128.0', 'width: 160.0']. Sort subplot per setting.
  y_metrics = ['PSNR (dB)', 'PSNR (dB)']. Metric to plot per subplot.
  x_metric = 'bitrate (kbps)'

◆ StringToFloat()

def plot_webrtc_test_logs.StringToFloat (   value)

◆ ToString()

def plot_webrtc_test_logs.ToString (   input_list)

◆ ToStringWithoutMetric()

def plot_webrtc_test_logs.ToStringWithoutMetric (   input_list,
  metric 
)

◆ TryFindMetric()

def plot_webrtc_test_logs.TryFindMetric (   parsed,
  line,
  f 
)

Variable Documentation

◆ AVG_KEY_FRAME_SIZE

tuple plot_webrtc_test_logs.AVG_KEY_FRAME_SIZE = ('Average key frame size', 'avg key frame size (bytes)')

◆ AVG_NON_KEY_FRAME_SIZE

tuple plot_webrtc_test_logs.AVG_NON_KEY_FRAME_SIZE
Initial value:
1 = ('Average non-key frame size',
2  'avg non-key frame size (bytes)')

◆ BITRATE

tuple plot_webrtc_test_logs.BITRATE = ('Target Bitrate', 'bitrate (kbps)')

◆ CODEC_TYPE

tuple plot_webrtc_test_logs.CODEC_TYPE = ('Codec type', 'Codec')

◆ CORES

tuple plot_webrtc_test_logs.CORES = ('#CPU cores used', 'CPU cores used')

◆ DECODE_TIME

tuple plot_webrtc_test_logs.DECODE_TIME = ('Decoding time', 'decode time (us)')

◆ DECODE_TIME_AVG

tuple plot_webrtc_test_logs.DECODE_TIME_AVG = ('Decoding time', 'decode time (us) avg')

◆ DECODER_IMPLEMENTATION_NAME

tuple plot_webrtc_test_logs.DECODER_IMPLEMENTATION_NAME = ('Decoder implementation name', 'dec name')

◆ DENOISING

tuple plot_webrtc_test_logs.DENOISING = ('Denoising', 'denoising')

◆ ENC_BITRATE

tuple plot_webrtc_test_logs.ENC_BITRATE = ('Encoding bitrate', 'encoded bitrate (kbps)')

◆ ENCODE_TIME

tuple plot_webrtc_test_logs.ENCODE_TIME = ('Encoding time', 'encode time (us)')

◆ ENCODE_TIME_AVG

tuple plot_webrtc_test_logs.ENCODE_TIME_AVG = ('Encoding time', 'encode time (us) avg')

◆ ENCODER_IMPLEMENTATION_NAME

tuple plot_webrtc_test_logs.ENCODER_IMPLEMENTATION_NAME = ('Encoder implementation name', 'enc name')

◆ ERROR_CONCEALMENT

tuple plot_webrtc_test_logs.ERROR_CONCEALMENT = ('Error concealment', 'error concealment')

◆ EVENT_END

string plot_webrtc_test_logs.EVENT_END = 'OK ] CodecSettings/PlotVideoProcessorIntegrationTest.'

◆ EVENT_START

string plot_webrtc_test_logs.EVENT_START = 'RUN ] CodecSettings/PlotVideoProcessorIntegrationTest.'

◆ FIG_SIZE_SCALE_FACTOR_X

int plot_webrtc_test_logs.FIG_SIZE_SCALE_FACTOR_X = 2

◆ FIG_SIZE_SCALE_FACTOR_Y

float plot_webrtc_test_logs.FIG_SIZE_SCALE_FACTOR_Y = 2.8

◆ FILENAME

tuple plot_webrtc_test_logs.FILENAME = ('Filename', 'clip')

◆ FRAME_SIZE

tuple plot_webrtc_test_logs.FRAME_SIZE = ('Frame sizes', 'frame size (bytes)')

◆ FRAME_SIZE_AVG

tuple plot_webrtc_test_logs.FRAME_SIZE_AVG = ('Frame sizes', 'frame size (bytes) avg')

◆ FRAMERATE

tuple plot_webrtc_test_logs.FRAMERATE = ('Frame rate', 'fps')

◆ GRID_COLOR

list plot_webrtc_test_logs.GRID_COLOR = [0.45, 0.45, 0.45]

◆ HEIGHT

tuple plot_webrtc_test_logs.HEIGHT = ('Height', 'height')

◆ METRICS_TO_PARSE

list plot_webrtc_test_logs.METRICS_TO_PARSE = SETTINGS + SUBPLOT_SETTINGS + RESULTS

◆ NUM_DROPPED_FRAMES

tuple plot_webrtc_test_logs.NUM_DROPPED_FRAMES = ('Number of dropped frames', 'num dropped frames')

◆ NUM_FRAMES

tuple plot_webrtc_test_logs.NUM_FRAMES = ('Total # of frames', 'num frames')

◆ NUM_FRAMES_TO_TARGET

tuple plot_webrtc_test_logs.NUM_FRAMES_TO_TARGET
Initial value:
1 = ('Number of frames to approach target rate',
2  'frames to reach target rate')

◆ PSNR

tuple plot_webrtc_test_logs.PSNR = ('PSNR avg', 'PSNR (dB)')

◆ QP

tuple plot_webrtc_test_logs.QP = ('Average QP', 'avg QP')

◆ RESILIENCE

tuple plot_webrtc_test_logs.RESILIENCE = ('Resilience', 'resilience')

◆ RESULTS

list plot_webrtc_test_logs.RESULTS
Initial value:
1 = [
2  PSNR,
3  SSIM,
4  ENC_BITRATE,
5  NUM_DROPPED_FRAMES,
6  NUM_FRAMES_TO_TARGET,
7  ENCODE_TIME_AVG,
8  DECODE_TIME_AVG,
9  QP,
10  AVG_KEY_FRAME_SIZE,
11  AVG_NON_KEY_FRAME_SIZE,
12 ]

◆ SETTINGS

list plot_webrtc_test_logs.SETTINGS
Initial value:
1 = [
2  WIDTH,
3  HEIGHT,
4  FILENAME,
5  NUM_FRAMES,
6  ENCODE_TIME,
7  DECODE_TIME,
8  FRAME_SIZE,
9 ]

◆ SSIM

tuple plot_webrtc_test_logs.SSIM = ('SSIM avg', 'SSIM')

◆ SUBPLOT_SETTINGS

list plot_webrtc_test_logs.SUBPLOT_SETTINGS
Initial value:
1 = [
2  CODEC_TYPE,
3  ENCODER_IMPLEMENTATION_NAME,
4  DECODER_IMPLEMENTATION_NAME,
5 ] + X_SETTINGS

◆ WIDTH

tuple plot_webrtc_test_logs.WIDTH = ('Width', 'width')

◆ X_SETTINGS

list plot_webrtc_test_logs.X_SETTINGS
Initial value:
1 = [
2  CORES,
3  FRAMERATE,
4  DENOISING,
5  RESILIENCE,
6  ERROR_CONCEALMENT,
7  BITRATE, # TODO(asapersson): Needs to be last.
8 ]

◆ Y_METRICS

list plot_webrtc_test_logs.Y_METRICS = [res[1] for res in RESULTS]