You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.7KB

  1. /*
  2. * This file is part of Libav.
  3. *
  4. * Libav is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * Libav is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with Libav; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #include "error_resilience.h"
  19. #include "mpegvideo.h"
  20. #include "mpeg_er.h"
  21. static void set_erpic(ERPicture *dst, Picture *src)
  22. {
  23. int i;
  24. if (!src) {
  25. dst->f = NULL;
  26. dst->tf = NULL;
  27. return;
  28. }
  29. dst->f = src->f;
  30. dst->tf = &src->tf;
  31. for (i = 0; i < 2; i++) {
  32. dst->motion_val[i] = src->motion_val[i];
  33. dst->ref_index[i] = src->ref_index[i];
  34. }
  35. dst->mb_type = src->mb_type;
  36. dst->field_picture = src->field_picture;
  37. }
  38. void ff_mpeg_er_frame_start(MpegEncContext *s)
  39. {
  40. ERContext *er = &s->er;
  41. set_erpic(&er->cur_pic, s->current_picture_ptr);
  42. set_erpic(&er->next_pic, s->next_picture_ptr);
  43. set_erpic(&er->last_pic, s->last_picture_ptr);
  44. er->pp_time = s->pp_time;
  45. er->pb_time = s->pb_time;
  46. er->quarter_sample = s->quarter_sample;
  47. er->partitioned_frame = s->partitioned_frame;
  48. ff_er_frame_start(er);
  49. }