shithub: libvpx

Download patch

ref: ef7f489dc339c7f1d29cd1c442b57f2a1fd92840
parent: 573a3f35eaed30a986a9d97905f05881f602bf9c
parent: 2c3c54f7475021e2fbc62998b042e54efa9f142c
author: John Koleszar <jkoleszar@google.com>
date: Fri Jul 8 04:57:03 EDT 2011

Merge remote branch 'internal/upstream-experimental' into HEAD

--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -4681,6 +4681,20 @@
 }
 
 
+static int frame_is_reference(const VP8_COMP *cpi)
+{
+    const VP8_COMMON *cm = &cpi->common;
+    const MACROBLOCKD *xd = &cpi->mb.e_mbd;
+
+    return cm->frame_type == KEY_FRAME || cm->refresh_last_frame
+           || cm->refresh_golden_frame || cm->refresh_alt_ref_frame
+           || cm->copy_buffer_to_gf || cm->copy_buffer_to_arf
+           || cm->refresh_entropy_probs
+           || xd->mode_ref_lf_delta_update
+           || xd->update_mb_segmentation_map || xd->update_mb_segmentation_data;
+}
+
+
 int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, INT64 *time_stamp, INT64 *time_end, int flush)
 {
 #if HAVE_ARMV7
@@ -4937,6 +4951,7 @@
     // if its a dropped frame honor the requests on subsequent frames
     if (*size > 0)
     {
+        cpi->droppable = !frame_is_reference(cpi);
 
         // return to normal state
         cm->refresh_entropy_probs = 1;
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -619,6 +619,7 @@
 #if CONFIG_REALTIME_ONLY
     int force_next_frame_intra; /* force next frame to intra when kf_auto says so */
 #endif
+    int droppable;
 } VP8_COMP;
 
 void control_data_rate(VP8_COMP *cpi);
--- a/vp8/vp8_cx_iface.c
+++ b/vp8/vp8_cx_iface.c
@@ -820,6 +820,9 @@
                     pkt.data.frame.duration = 0;
                 }
 
+                if (cpi->droppable)
+                    pkt.data.frame.flags |= VPX_FRAME_IS_DROPPABLE;
+
                 if (cpi->output_partition)
                 {
                     int i;