]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegvideo.c
place SPS/PPS in extradata if GLOBAL_HEADER flag is set
[ffmpeg] / libavcodec / mpegvideo.c
index 731a502c256c2b86f793b5e4dbc109eb50317a5a..6ae89185ad735546c9c7e35628629b31f0f0f466 100644 (file)
@@ -15,7 +15,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *
  * 4MV & hq & b-frame encoding stuff by Michael Niedermayer <michaelni@gmx.at>
  */
@@ -1139,7 +1139,7 @@ int MPV_encode_init(AVCodecContext *avctx)
         break;
     case CODEC_ID_H263:
         if (h263_get_picture_format(s->width, s->height) == 7) {
-            av_log(avctx, AV_LOG_INFO, "Input picture size isn't suitable for h263 codec! try h263+\n");
+            av_log(avctx, AV_LOG_INFO, "The specified picture size of %dx%d is not valid for the H.263 codec.\nValid sizes are 128x96, 176x144, 352x288, 704x576, and 1408x1152. Try H.263+.\n", s->width, s->height);
             return -1;
         }
         s->out_format = FMT_H263;
@@ -1594,6 +1594,7 @@ void MPV_frame_end(MpegEncContext *s)
     emms_c();
 
     s->last_pict_type    = s->pict_type;
+    s->last_lambda_for[s->pict_type]= s->current_picture_ptr->quality;
     if(s->pict_type!=B_TYPE){
         s->last_non_b_pict_type= s->pict_type;
     }
@@ -2204,7 +2205,7 @@ static int estimate_best_b_count(MpegEncContext *s){
             int is_p= i % (j+1) == j || i==s->max_b_frames;
 
             input[i+1].pict_type= is_p ? P_TYPE : B_TYPE;
-            input[i+1].quality= s->rc_context.last_qscale_for[input[i+1].pict_type];
+            input[i+1].quality= s->last_lambda_for[input[i+1].pict_type];
             out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[i+1]);
             rd += (out_size * lambda2) >> FF_LAMBDA_SHIFT;
         }
@@ -5398,12 +5399,10 @@ static void encode_picture(MpegEncContext *s, int picture_number)
         estimate_qp(s, 1);
         ff_get_2pass_fcode(s);
     }else if(!(s->flags & CODEC_FLAG_QSCALE)){
-        RateControlContext *rcc= &s->rc_context;
-
         if(s->pict_type==B_TYPE)
-            s->lambda= rcc->last_qscale_for[s->pict_type];
+            s->lambda= s->last_lambda_for[s->pict_type];
         else
-            s->lambda= rcc->last_qscale_for[rcc->last_non_b_pict_type];
+            s->lambda= s->last_lambda_for[s->last_non_b_pict_type];
         update_qscale(s);
     }