History

Merge commit 'b85a5e87af4254b80913fe33591d96361f30832b'

* commit 'b85a5e87af4254b80913fe33591d96361f30832b': lavu: Add av_strnstr() h264: Allow discarding the cropping information from SPS Conflicts: Changelog doc/APIchanges libavcodec/avcodec.h libavcodec/version.h libavutil/version.h

Michael Niedermayer committed 13 years ago

Commit 25be6302 parents b2d0c5b b85a5e89 files · +53 −3Browse files

Unified · Split

9 files
  1. Changelog +1 −0
  2. doc/APIchanges +3 −0
  3. libavcodec/avcodec.h +2 −0
  4. libavcodec/h264_ps.c +14 −0
  5. libavcodec/options_table.h +1 −0
  6. libavcodec/version.h +1 −1
  7. libavutil/avstring.c +14 −0
  8. libavutil/avstring.h +15 −0
  9. libavutil/version.h +2 −2
Changelog+1−0
@@ -9,6 +9,7 @@ version <next>: · 8 unmodified lines
99 - Theora Midstream reconfiguration support
1010 - EVRC decoder
1111 - audio fade filter
12+- av_strnstr
1213
1314
1415 version 1.1:
doc/APIchanges+3−0
@@ -135,6 +135,9 @@ API changes, most recent first: · 134 unmodified lines
135135 2012-03-26 - a67d9cf - lavfi 2.66.100
136136 Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
137137
138+2013-01-xx - xxxxxxx - lavu 52.6.0 - avstring.h
139+ Add av_strnstr()
140+
138141 2013-01-xx - xxxxxxx - lavu 52.5.0 - hmac.h
139142 Add AVHMAC.
140143
libavcodec/avcodec.h+2−0
@@ -713,6 +713,8 @@ typedef struct RcOverride{ · 712 unmodified lines
713713 #define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.
714714 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.
715715 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. DEPRECATED!!!!
716+#define CODEC_FLAG2_IGNORE_CROP 0x00010000 ///< Discard cropping information from SPS.
717+
716718 #if FF_API_MPV_GLOBAL_OPTS
717719 #define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp.
718720 #define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon.
libavcodec/h264_ps.c+14−0
@@ -471,6 +471,20 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){ · 470 unmodified lines
471471 sps->crop_right = get_ue_golomb(&s->gb);
472472 sps->crop_top = get_ue_golomb(&s->gb);
473473 sps->crop_bottom= get_ue_golomb(&s->gb);
474+ if (h->s.avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
475+ av_log(h->s.avctx, AV_LOG_DEBUG,
476+ "discarding sps cropping, "
477+ "original values are l:%u r:%u t:%u b:%u\n",
478+ sps->crop_left,
479+ sps->crop_right,
480+ sps->crop_top,
481+ sps->crop_bottom);
482+
483+ sps->crop_left =
484+ sps->crop_right =
485+ sps->crop_top =
486+ sps->crop_bottom = 0;
487+ }
474488 if(sps->crop_left || sps->crop_top){
475489 av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ... (left: %d, top: %d)\n", sps->crop_left, sps->crop_top);
476490 }
libavcodec/options_table.h+1−0
@@ -79,6 +79,7 @@ static const AVOption options[]={ · 78 unmodified lines
7979 {"sgop", "Deprecated, use mpegvideo private options instead", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"},
8080 #endif
8181 {"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"},
82+{"ignorecrop", "ignore cropping information from sps", 1, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, "flags2"},
8283 {"local_header", "place global headers at every keyframe instead of in extradata", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, "flags2"},
8384 {"chunks", "Frame data might be split into multiple chunks", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_CHUNKS }, INT_MIN, INT_MAX, V|D, "flags2"},
8485 {"showall", "Show all frames before the first keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SHOW_ALL }, INT_MIN, INT_MAX, V|D, "flags2"},
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include "libavutil/avutil.h"
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 54
32−#define LIBAVCODEC_VERSION_MINOR 90
32+#define LIBAVCODEC_VERSION_MINOR 91
3333 #define LIBAVCODEC_VERSION_MICRO 100
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
libavutil/avstring.c+14−0
@@ -65,6 +65,20 @@ char *av_stristr(const char *s1, const char *s2) · 64 unmodified lines
6565 return NULL;
6666 }
6767
68+char *av_strnstr(const char *haystack, const char *needle, size_t hay_length)
69+{
70+ size_t needle_len = strlen(needle);
71+ if (!needle_len)
72+ return haystack;
73+ while (hay_length >= needle_len) {
74+ hay_length--;
75+ if (!memcmp(haystack, needle, needle_len))
76+ return haystack;
77+ haystack++;
78+ }
79+ return NULL;
80+}
81+
6882 size_t av_strlcpy(char *dst, const char *src, size_t size)
6983 {
7084 size_t len = 0;
libavutil/avstring.h+15−0
@@ -66,6 +66,21 @@ int av_stristart(const char *str, const char *pfx, const char **ptr); · 65 unmodified lines
6666 */
6767 char *av_stristr(const char *haystack, const char *needle);
6868
69+/**
70+ * Locate the first occurrence of the string needle in the string haystack
71+ * where not more than hay_length characters are searched. A zero-length
72+ * string needle is considered to match at the start of haystack.
73+ *
74+ * This function is a length-limited version of the standard strstr().
75+ *
76+ * @param haystack string to search in
77+ * @param needle string to search for
78+ * @param hay_length length of string to search in
79+ * @return pointer to the located match within haystack
80+ * or a null pointer if no match
81+ */
82+char *av_strnstr(const char *haystack, const char *needle, size_t hay_length);
83+
6984 /**
7085 * Copy the string src to dst, but no more than size - 1 bytes, and
7186 * null-terminate dst.
libavutil/version.h+2−2
@@ -75,8 +75,8 @@ · 74 unmodified lines
7575 */
7676
7777 #define LIBAVUTIL_VERSION_MAJOR 52
78−#define LIBAVUTIL_VERSION_MINOR 15
79−#define LIBAVUTIL_VERSION_MICRO 103
78+#define LIBAVUTIL_VERSION_MINOR 16
79+#define LIBAVUTIL_VERSION_MICRO 100
8080
8181 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
8282 LIBAVUTIL_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t