shithub: libvpx

Download patch

ref: b0050f27e27c59312a12c037b263a1bb71df4f3c
parent: f57fa3f1df45ea80049ff831a054ac66a12aebdc
author: Angie Chiang <angiebird@google.com>
date: Tue Jan 19 13:56:48 EST 2021

Use VPX_CODEC_INVALID_PARAM when ext_ratectrl=NULL

Bug: webm:1716

Change-Id: Ic60c367aabfc03d94816e85476895b988aced5f1

--- a/vp9/encoder/vp9_ext_ratectrl.c
+++ b/vp9/encoder/vp9_ext_ratectrl.c
@@ -15,7 +15,7 @@
 
 vpx_codec_err_t vp9_extrc_init(EXT_RATECTRL *ext_ratectrl) {
   if (ext_ratectrl == NULL) {
-    return VPX_CODEC_ERROR;
+    return VPX_CODEC_INVALID_PARAM;
   }
   vp9_zero(*ext_ratectrl);
   return VPX_CODEC_OK;
@@ -27,7 +27,7 @@
   vpx_rc_status_t rc_status;
   vpx_rc_firstpass_stats_t *rc_firstpass_stats;
   if (ext_ratectrl == NULL) {
-    return VPX_CODEC_ERROR;
+    return VPX_CODEC_INVALID_PARAM;
   }
   vp9_extrc_delete(ext_ratectrl);
   ext_ratectrl->funcs = funcs;
@@ -52,7 +52,7 @@
 
 vpx_codec_err_t vp9_extrc_delete(EXT_RATECTRL *ext_ratectrl) {
   if (ext_ratectrl == NULL) {
-    return VPX_CODEC_ERROR;
+    return VPX_CODEC_INVALID_PARAM;
   }
   if (ext_ratectrl->ready) {
     vpx_rc_status_t rc_status =
@@ -97,7 +97,7 @@
 vpx_codec_err_t vp9_extrc_send_firstpass_stats(
     EXT_RATECTRL *ext_ratectrl, const FIRST_PASS_INFO *first_pass_info) {
   if (ext_ratectrl == NULL) {
-    return VPX_CODEC_ERROR;
+    return VPX_CODEC_INVALID_PARAM;
   }
   if (ext_ratectrl->ready) {
     vpx_rc_status_t rc_status;
@@ -141,7 +141,7 @@
     RefCntBuffer *ref_frame_bufs[MAX_INTER_REF_FRAMES], int ref_frame_flags,
     vpx_rc_encodeframe_decision_t *encode_frame_decision) {
   if (ext_ratectrl == NULL) {
-    return VPX_CODEC_ERROR;
+    return VPX_CODEC_INVALID_PARAM;
   }
   if (ext_ratectrl->ready) {
     vpx_rc_status_t rc_status;
@@ -170,7 +170,7 @@
     const YV12_BUFFER_CONFIG *coded_frame, uint32_t bit_depth,
     uint32_t input_bit_depth) {
   if (ext_ratectrl == NULL) {
-    return VPX_CODEC_ERROR;
+    return VPX_CODEC_INVALID_PARAM;
   }
   if (ext_ratectrl->ready) {
     PSNR_STATS psnr;